SO I was testing the mailing message for my website for customer reviews. I sent about 20 mails to myself to check the format and make sure it's well done . I received all the test emails I did and everything was going well.
But suddenly, no emails were sent, out of nowhere I stopped receiving anything and I'm honestly panicking .
This is my code:
if(isset($_POST['submit'])){
$to = "mo.merhi01@lau.edu";
$from = $_POST['email'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$subject = "Seeker Feedback and Review";
$subject2 = "Copy of your form submission";
$message2 = "Here is a copy of your message " . $_POST['id'] . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "To:" . $to;
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From:". $from . "\r\n" .
"Reply-To: ".$to . "\r\n" .
"X-Mailer: PHP/" . phpversion();
$message = '<html><body>';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Seeker UsernameName:</strong> </td><td>" . strip_tags($_POST['id']) . "</td></tr>";
$message .= "<tr style='background: #eee;'><td><strong>Seeker Name:</strong> </td><td>" . strip_tags($_POST['id1']) . "</td></tr>";
$message .= "<tr><td><strong>Provider's First Name</strong> </td><td>" . strip_tags($_POST['first_name']) . "</td></tr>";
$message .= "<tr><td><strong>Title of the Service reviewed</strong> </td><td>" . $title. "</td></tr>";
$message .= "<tr><td><strong>Type of the Service:</strong> </td><td>" . $type . "</td></tr>";
$message .= "<tr><td><strong>Description of the Service:</strong> </td><td>" . $description . "</td></tr>";
$message .= "<tr><td><strong>Date Started</strong> </td><td>" . $date_from . "</td></tr>";
$message .= "<tr><td><strong>Date Due</strong> </td><td>" . $date_to . "</td></tr>";
$message .= "<tr><td><strong>Review</strong> </td><td>" . $_POST['message'] . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $_POST['id1'] . ", we will contact you shortly.";
}
?>
I tested ALL the variables in there by echoing all of them, the form in the html is working perfectly ( I tested it ) they're all perfectly fine and there's no null variable! Help, What could have happened?