View Single Post
Old 03-15-2006, 10:12 AM   #4 (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

Quote:
Originally posted by TheHeadFL
don't you need to enclose the predicate for the IF statement in ()
im sorry, you're correct. i needed to enclose the mail function in (). Here's the working code.

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.";

?>

office politics is offline   Reply With Quote