HELP!!!
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.
com.sun.mail.util.MailConnectException: Couldn’t connect to host, port: smtp.office365.com, 587; timeout 60000; nested exception is: java.net.SocketException: Permission denied: connect
<cfmail from=”noreply@mydomain.com”
to=”me@mydomain.com”
subject=”Test Email”
type=”html”
port=”587″
useTLS=”true”
server=”smtp.office365.com”
username=”noreply@mydomain.com”
password=”mypassword”>
Test message
</cfmail>
This works:
<cfmail from=”service@anotherdomain.com”
to=”me@mydomain.com”
subject=”Google Mail”
type=”html”
server=”smtp.gmail.com”
port=”465″
useSSL=”true”
username=”service@anotherdomain.com”
password=”thepassword”>
Test Message
</cfmail>
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.
You must be logged in to post a comment.