I'm having an issue where we've recently upgraded to exchange online(office365) and even tho I updated the PHPmailer info on my Ubuntu server, now my web server will not send email. I've gone through and checked the necessary settings and configured it using the following Technet article.
in the webapp I'm using the following code.
$mailer = new PHPMailer();
$mailer->SMTPSecure = "tls";
$mailer->Host = "smtp.office365.com";
$mailer->Port = "587"; also tested with 25
$mailer->Username = "Authenticated username";
$mailer->Password = "password for said authen user";
$mailer->Subject = "subject";
What I'm seeing in the mail.log of my server are 2 errors.
Valid_hostname: Invalid Character 92 (decimal): \032controlsequipment-com.
malformed domain name in resource data of MX record for controlsequipment.com: \032controlsequipment-com.
Based on these messages, I'm assuming the error is due to the dash in the MX record which is a copy and paste from the Exchange online Domain records list. I've called M$ and they've said that is the proper configuration.
So my question is, how do I get around it with my web app? I've gone through a bunch of resources on how to configure it but I have the exact same configuration and none of the resources I've gone to mention getting the errors above. I'm at a loss right now what my next step is.