newbie79 Posted July 29, 2007 Share Posted July 29, 2007 I'm trying to make an email form work. I get a syntax error as follows Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Users/nlnewbr/Sites/testdontbankit/tmessageSent.php on line 5 Is this the correct code? <?php $to = "xxx@yahoo.com"; $reply_message_subject = $_POST['subject']; $reply_message_body = $_POST['body']; $config_mailheaders="From:xxx@yahoo.com"; $reply_body=<<<_MAIL_ $reply_message_name = $_POST['name']; $reply_message_address = $_POST['address']; $reply_message_phoneno = $_POST['phoneno']; $reply_message_body _MAIL_; mail($to,$reply_subject,$reply_body,$config_mailheaders)} ?> Thanks for your help! Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 29, 2007 Share Posted July 29, 2007 I think your problem is due to you trying to create and assign values to variables inside of your HEREDOC syntax... Quote Link to comment Share on other sites More sharing options...
newbie79 Posted July 29, 2007 Author Share Posted July 29, 2007 How do I go about correcting this problem? This is my first time using php so I'm a bit confused. Thank you. Quote Link to comment Share on other sites More sharing options...
dewey_witt Posted July 29, 2007 Share Posted July 29, 2007 //set up the mail variables $subject= $_POST['subject'] $name = $_POST['name']; $address = $_POST['address']; $phoneno = $_POST['phoneno']; $recipient = "XXX@yahoo.com"; $subject = "$subject"; $msg = "Name: $name"; $msg .="Address: $address"; $msg .="Phoneno: $phoneno"; $mailheader = "From:webmaster@yourdomain.com <YourDomain.com>\n"; $mailheader .= "Return-Path: <webmaster@yourdomain.com>\n"; // all variables set up, mail the contents... mail($recipient,$subject,$msg,$mailheader); try this. Shoukld work. Make sure you put in YOUR info for return path and recipiant Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.