perezf Posted February 16, 2007 Share Posted February 16, 2007 I am recieving an error everytime i add this to my page. the error is "i have modified the code below to keep what site it is private Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in on line 44Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 44 <?php if($_POST['Submit'] && isset($_POST['email']) && isset($_POST['comments'])) { $to = "[email protected]"; $subject = $_POST['who']; $body = $_POST['comments']; $from = "From: ".$_POST['email']; mail($to,$subject,$body,$from) echo "<p>Your Message has been Sent!</p>"; } ?> Link to comment https://forums.phpfreaks.com/topic/38752-php-emailer-help-error/ Share on other sites More sharing options...
perezf Posted February 16, 2007 Author Share Posted February 16, 2007 Can Anyone Help Me?? Link to comment https://forums.phpfreaks.com/topic/38752-php-emailer-help-error/#findComment-186201 Share on other sites More sharing options...
clarke78 Posted February 16, 2007 Share Posted February 16, 2007 Here try this.. <?php /* recipients */ $recipient .= "[email protected]"; /* subject */ $subject = "Checking PHP mail"; /* message */ $message .= "This is a test mail \n"; /* you can add a stock signature */ $message .= "-\r\n"; //Signature delimiter /* additional header pieces for errors, From cc's, bcc's, etc */ $headers .= "From: The great webmaster \n"; $headers .= "To-Sender: \n"; $headers .= "X-Mailer: PHP\n"; // mailer $headers .= "X-Priority: 1\n"; // Urgent message! $headers .= "Return-Path: \n"; // Return path for errors /* If you want to send html mail, uncomment the following line */ // $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type $headers .= ""; // CC to $headers .= ""; // BCCs to /* and now mail it */ mail($recipient, $subject, $message, $headers); ?> And if it doesnt work then you might not be able to send email from your server. Although I highly doubt that. Link to comment https://forums.phpfreaks.com/topic/38752-php-emailer-help-error/#findComment-186249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.