ldoozer Posted September 28, 2007 Share Posted September 28, 2007 Can anyone tell me why this is only sending the text but not sending the variables in the email. I have checked that my form method is post and my names in the html are correct. <?php $to = "[email protected]"; $message = "order: \r\n\r\nCustomer Name: ".$MC_Name."\r\nCustomer Address: ".$MC_Address."\r\nCustomer Postcode: ".$MC_Code."\r\nCustomer Email: ".$MC_Email."\r\nCustomer Phone: ".$MC_Phone."\r\nPlant in: ".$MC_Location."\r\nMessage on Certificate: ".$MC_Message."\r\nGift Name: ".$MC_Gift_Name."\r\nGift Address: ".$MC_Gift_Address."\r\nGift Postcode: ".$MC_Gift_Code."\r\nPayment Method: ".$method."\r\n\r\nEnd of order"; $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to, "Order", $message, "from: [email protected] \r\n"); ?> Link to comment https://forums.phpfreaks.com/topic/71059-sendmail/ Share on other sites More sharing options...
BlueSkyIS Posted September 28, 2007 Share Posted September 28, 2007 because the variables are never given a value. What is the value of $MC_Name? Link to comment https://forums.phpfreaks.com/topic/71059-sendmail/#findComment-357270 Share on other sites More sharing options...
ldoozer Posted September 28, 2007 Author Share Posted September 28, 2007 are they not sent a value when the html form is submitted? Link to comment https://forums.phpfreaks.com/topic/71059-sendmail/#findComment-357275 Share on other sites More sharing options...
SharkBait Posted September 28, 2007 Share Posted September 28, 2007 They are sent but you need to process them <?php if(!empty($_POST['valuename'])) { $MC_Name = $_POST['valuename']; } ?> Link to comment https://forums.phpfreaks.com/topic/71059-sendmail/#findComment-357297 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.