I am trying to set up a PHP-based contact form on my site. Everything sends just fine and reaches my e-mail box, except that the sender's e-mail doesn't appear in the "from" area of the e-mail. Instead my host fills in some random domain and that's it. Screen-shotted below...
Screenshot
I've have searched endlessly, sent numerous test e-mails, and a bunch of other BS I can't even think of because my brain is so fried out from this....but I think I'm close. I've attached my PHP code. I've taken out all of my changes to it (in efforts to get this to work) so as to not confuse everyone with junk code.
Someone, please, give me a hand here.
-thanks
<?php
if(isset($_POST['Submit'])) {
$to = "edited";
$name_field = $_POST['name1'];
$email_field = $_POST['email1'];
$subject_field = $_POST['subject1'];
$subject = $_POST['subject1'];
$message = $_POST['message1'];
$body = "Name: $name_field\n E-Mail: $email_field\n Subject: $subject_field\n Message: $message";
echo "Your E-mail has been submitted. We will get back to you when time permits.";
echo "You may now close this window.";
mail($to, $subject, $body);
} else {
echo "Delivery Failed!";
}
?>
Screenshot
I've have searched endlessly, sent numerous test e-mails, and a bunch of other BS I can't even think of because my brain is so fried out from this....but I think I'm close. I've attached my PHP code. I've taken out all of my changes to it (in efforts to get this to work) so as to not confuse everyone with junk code.
Someone, please, give me a hand here.
-thanks
<?php
if(isset($_POST['Submit'])) {
$to = "edited";
$name_field = $_POST['name1'];
$email_field = $_POST['email1'];
$subject_field = $_POST['subject1'];
$subject = $_POST['subject1'];
$message = $_POST['message1'];
$body = "Name: $name_field\n E-Mail: $email_field\n Subject: $subject_field\n Message: $message";
echo "Your E-mail has been submitted. We will get back to you when time permits.";
echo "You may now close this window.";
mail($to, $subject, $body);
} else {
echo "Delivery Failed!";
}
?>