Hey all,
This script used to work perfectly, but for some reason it doesn't anymore.
All works well, mails get sent, but the confirmation mail doesn't.
How come?
Here is the code:
Code:
<?php
if ($_POST["action"] == "send"){
if ($_POST[name] != "" and $_POST[email] != "" and $_POST[subject] != "" and $_POST[message] != "") {
mail ("me@mywebsite.com", "mail via website",
"
Name: ".$_POST['name']."
E-mail: ".$_POST['email']."
Subject: ".$_POST['subject']."
Message: ".$_POST['message']."
",
"From: ".$_POST['name']." <".$_POST['email'].">");
$headers[] = 'From: mywebsite.com';
$subject = "confirmation mail";
$msg = "
(This is an automatically sent message. Please do not reply.)
Dear $_POST[name],
Thanks for your interest.
Surely I will get back to you within a short delay.
In case you need fast response, please do not hesitate calling me.
Thanks.
Enjoy your day.
Kind regards.
";
mail($_POST[email], $subject, $msg, implode("\r\n", $headers));
echo '<br><div style="background-color:#fff;border:2px solid #e61875;padding:20px;color:#393939;margin:auto;width:80%;text-align:center;"><p><br>Thanks for your thoughts. Surely I will get back to you within a short delay.<br>In case you need fast response, please do not hesitate calling me.</p></div>';
}
else{
echo '<br><div style="background-color:#e61875;border:2px solid #fff;padding:20px;margin:auto;width:80%;text-align:center;color:#fff;"><p><br>Your thoughts could not be shared. Please try again filling in all fields.<br>Thanks.</p></div>';
}
}
?>
Bookmarks