View Single Post
Old 03-10-2006, 10:01 AM   #1 (permalink)
office politics
office politics's Avatar
 
It's all just 1s and 0s
Join Date: Jan 2004
Location: in the lab
Posts: 4,181
office politics will become famous soon enough
Default errors unexpected t_string using php mail function

PHP Code:
<?php

foreach ($_POST as $key => $value
  
$message $message.$key." - ".$value."\r\n";

$headers 'From: ' $_POST["Email"] . "\r\n" .
   
'Reply-To: ' $_POST["Email"] . "\r\n" .
   
'X-Mailer: PHP/' phpversion();

//echo $message;

if mail("email@domain.com""Contact Us Page"$message$headers)
  echo 
"Your email has been successfully sent

[url='/contact_us.htm']Click here[/url] to return to the previous page."
;
else
  echo 
"There was an error while trying to send the email.  Please call us at xxx.";

?>
when entering multiple lines for my Comments field i get a unexpected t_string error when trying to use the mail function

here's the commented echo $message output:

First_Name - c Last_name - samuels Company - fos Street - 125 west broadway City - salem State - nj ZipCode - 08079 Policy - test Telephone - 123-456-7890 Email - email@domain.com Comments - test another line and another and another B1 - Submit
office politics is offline   Reply With Quote