I am having a problem with an email form... When it's submitted it leaves out the email part, and it when you try to reply through email it goes to their name and not their email. I've tried changing the mailheaders to $email but it still didn't reply correctly either... infact it still put the name as the reply... basically it'll try to send it back to my own mail server with the address something like this: FirstName Lastname@smtp.mail.com
Here is my code:
<?php
// email.php --- sends mail, but doesn't say so...
// stuff from POST array (form)
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$address=$_POST['address'];
$city=$_POST['city'];
$state=$_POST['state'];
$zipcode=$_POST['zipcode'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$messagetext=$_POST['messagetext'];
$response=$_POST['response'];
// the date/time
$date=date('r', time());
$message="Date/Time: $date \n";
$message.="First Name: $firstname \n";
$message.="Last Name: $lastname \n";
$message.="Address: $address \n";
$message.="City: $city \n";
$message.="State: $state \n";
$message.="Zip Code: $zipcode \n";
$message.="Phone: $phone \n";
$message.="Email: $email \n";
$message.="Message: $messagetext \n";
$message.="How they want you to contact them: $response \n";
$mailheaders="From: $firstname $lastname\r\n";
$success=mail("mail@mail.com", "Contact Form Submission", $message, $mailheaders);
if ($success) {
echo " <html><body bgcolor=\"#ffffff\"><div align=center><font color=\"#000000\" size=5 face=\"Century Gothic\"><pre>Thank you for your submission! ";
echo "We will contact you shortly.</pre>";
} else {
echo "<pre>There was an error processing your email. Could you please go back and try";
echo " again? Thanks! </pre></font></div></body></html>";
}
?>
Anyone know why this isnt' working? I've used this basic form before on another site and it works perfectly??
Thank you so much!!!!
Ashley