Using SMTP with Office365

I’m trying to setup the SMTP mail option as I’ve been having send issues with the PHP mailer.

I worked with my client to get the details for sending mail through their office365.

When I put in the settings I get the following issue:
The following error was found while trying to send the test email:
stream_socket_enable_crypto(): Peer certificate CN=xxx.xxx.com' did not match expected CN=smtp.office365.com

I’ve also tested the settings they gave me with outlook and their send settings work fine through Outlook.

The smtp.office365.com is the server for the send mail. I’m using port 587 and TLS.

I am suspecting this may not be a “concrete” issue per se, but something that needs to be set up/changed in the server settings. (FYI the config previously restricted external sendings, and I used the Tweak config to adjust this and overcame that error, but then ran into this one.). I’m wondering if I need to add something to my DNS or perhaps the client needs to add something to their DNS.

FYI the xxx.xxx.com which is blocked out is a different web address than the client’s (it uses the server’s main address.)

Ideas?

Hmmm does this shed any light?

Thanks. In the process of taking a look. Some of the items it identifies I already did (e.g. WHM tweak settings). I’ll post back my findings for others.