I'm having issues with one of my clients PHP forms. No email has been received since 7/29 and they usually receive 1-2 a day at least. I've changed the port to 587 but emails are still not being delivered. No other changes have occurred and the PHP script returns "Mail Sent". They are using mail 11 and on web 10. The email is sent to a local account with forwards to their Gmail account.
Any ideas why this occurring or how to fix it? Is there an issue with mail 11 or web 10? Was mail 11 recently migrated? Below is the basic code for reference. Thanks!
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$body = $postData; //file_get_contents('contents.html');
$body = preg_replace('/\\\\/','', $body); //Strip backslashes
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 587; // set the SMTP server port
$mail->Host = "mail.domain.com"; // SMTP server
$mail->Username = "
[email protected]"; // SMTP server username
$mail->Password = "xxxxxxxxxxxx"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$mail->AddReplyTo($Email,$First_Name ." " . $Last_Name);
$mail->From = "
[email protected]";
$mail->FromName = "Domain Web Site";
$to = "
[email protected]";
$mail->AddAddress($to);
$mail->Subject = "Domain " . $Contact_Subject . " Submission";
$mail->AltBody = $postData; //"To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
$emailStatus = 'Sent';
} catch (phpmailerException $e) {
$errtxt = $e->errorMessage();
}
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent.';
}