Coldfusion Mail with Office 365
Well it took me well over a year, but this link finally got me going in the right direction while doing some stuff for a PHP site I’m working on. The key is the “Finding the SMTP Server”:
– Go back to the O365 portal and click the Admin menu and click on Office 365
– Click on the Domains category
– Select your primary domain (or the domain you wish to use) and then click Manage DNS
– Find the MX record and copy the Point To Address for that record.
– The format will be in this format: -.mail.protection.outlook.com or I have also seen -.mail.eo.outlook.com. If your domain was “XXYYZZ.COM” then your MX record would look like this: XXYYZZ-COM.mail.protection.outlook.com as an example.
You probably setup the format you’re looking for in your DNS and didn’t think twice about it; the address is NOT the smtp.office365.com address everyone’s accustomed to. I did the whole connector thing in the linked article above, and I got it to work without the connector, so you may or may not need it depending on your server’s environment. Bear in mind in your cfadmin, DO NOT use TLS with port 587 like you should… doesn’t work. But it does work unsecurely on port 25 (leave SSL and TLS both unchecked). Your mail server will be the address you found from you O365 admin or your server’s DNS MX record, followed by the username and password to your business’ O365 account.
Bear in mind this will only work if the ColdFusion and the DNS are on the SAME server. I tried it on my separate development server and no worky. Obviously the custom MX address is being checked. Don’t know whether the TLS thing is a CF or O365 problem, but it’s working nonetheless.
Thankfully, painfully easy, but not immediately obvious.