I’m moving all my sites to a new server and the new server will not send cfmail through Office365 SMTP. It works when I send using a Gmail account. I’m using the exact same code and the ColdFusion admin setting are the same. Old Server Windows 2008. New Server Windows 2012. Both using ColdFusion 2016 (all updates installed).
This is the error message in the mail error log. I’m guessing it has something to do with TTL.
Thanks for the replies. I figured it out. The antivirus software was blocking the mail.
From the exception, it seems like the server is not able to connect to office365 on port 587.
You can try invoking telnet <ip> <port> to see if it is working. If Telnet could not connect, it would say connection failed, which means your firewall is blocking the port.
Check to make sure the user is allowed to send via SMTP. Your admin might have those permissions denied by default.