Log in

View Full Version : confirmation mail not sending



chechu
12-25-2019, 12:32 PM
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:


<?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>';
}
}
?>

james438
12-25-2019, 06:45 PM
It works for me. Could the confirmation email be in your spam or have made changes to your email filters which has caused your emails to be automatically deleted? Another thought is that the content of your email has changed and is now triggering your email spam filters.

There was a short delay before I received both emails.

chechu
12-28-2019, 04:05 PM
Thanks, James.
Good to read.