Reply From PHP Form
I have this code below on a contact form on a website. The form uses a POST method and PHP_SELF on submit. The code works fine, but on receiving the form results, I can't reply to the email address. The email address shows up in the sent email, but I get a delivery error when I send a reply.
If anyone has any ideas on why this might be happening, please let me know.
************************************************
<?
$address = getenv("REMOTE_ADDR");
$email = "to@mymail.com";
if (isset($_POST['complete'])) {
$headers = "From: ($_POST[email_address])";
$from_first = ($_POST['first_name']);
$from_last = ($_POST['last_name']);
$body = stripslashes($_POST['comments']);
$body .= "
Thanks,
$from_first $from_last
This information was received from a form online. The user at IP address $address has given the recipient of this form permission to contact them.";
mail("$email", stripslashes($_POST['subject']), $body, $headers);
echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
exit;
}
$title = "Contact Jim & Amy Donley";
$description = "Do you have a question for us? If so, then just fill out this form and one of us will contact you soon.";
$keywords = "";
require ("images/navigation.php");
require ("events.php");
?>
|