Forum Moderators: coopster
I was hoping someone could point me in the right direction on this one. I'm working on a basic contact form, whose action points to a php thank you page which emails the form input to my client. I would like the email to show the email address entered on the form in the "From" field and the "Reply To" so that the client only needs to click reply to respond to the inquiry.
Right now the email sends ok, and all of the fields are there, but the "From" and "Reply to" are empty.
Here's the code that I'm using:
<?php
// ************Begin Configure***************
$to = "sales@company.com";
$subject = "More Info";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=utf-8\r\n";
$headers .= "From: $Email <$Email> \r\n";
$headers .= "Reply-To: $Email \r\n";
$headers .= "X-Mailer: PHP/" . phpversion();// ************End Configure****************
$message = "";
foreach($HTTP_POST_VARS as $key => $value)
{
$message .= $key . ": " . $value . "\n\n";
}
mail($to, $subject, $message, $headers);
?>
Thanks for the help!
Sari