Setup SMTP relay through Office 365

Connect on Social

Migrating to Office 365 in a small office there are usually some devices or LOB (Line of Business) apps that previously used the local exchange server and now need updating. Here are some pointers to help to get it working. In my case, the annoying problem was a LOB that had a test button that confirmed everything working then sending emails didn’t work 🙁

So at the moment the details needed for SMTP relay are as follows

From Address
Microsoft Office 365 E-mail Address
Reply to Address
Microsoft Office 365 E-mail Address
Mail Server
smtp.office365.com
Port
587
Login
Microsoft Office 365 Account Username
Password
Microsoft Office 365 Account Password
Time out (sec)
60
Message Time out (sec)
60
Use TLS Encryption
Yes

The important part was to make sure the from address matches the credentials used, to ensure the correct send as permissions. With the configuration, I worked on the timeout as this was an issue with the application which was batching emails and had a low timeout. Of course, not everything will have these settings but you can test sending from windows desktop Using PowerShell.

$msolcred = get-credential
Send-MailMessage –From user@domain.com –To user@hotmail.com –Subject “Test Email” 
–Body “Test SMTP Relay Service” -SmtpServer smtp.office365.com -Credential $msolcred -UseSsl -Port 587

Another important point is the TLS configuration I had to use in the LOB I setup, compared to the PowerShell testing. If you have issues with sending and have multiple selections for TLS/Ssl try different options.

Hope this helps others.


About Mr Wilde

Technology has been in my blood for as long as I can remember. Started with Dick Smith kits when I was 10, I was making FM wireless bugs in high school. After several years working, Electronics Technician, Sound and Lighting Technical Director and then IT Sysadmin, I am going with the flow and leaving the hardware behind, mostly. I am now developing solutions for the cloud, focus on WordPress, SharePoint and Mobile devices. Learning more and more every day.


Leave a Reply

Your email address will not be published.