Monthly Archives: August 2016

Configure and Test SMTP for Office 365

After done about 60+ Office 365 migrations, I’ve noticed that almost all customers have Applications, Multi function printers or other devices that send some kind of email to end-users or suppliers/Customers.
These devices normally use the SMTP-Protocol.

To make sure that the emails is sent secure, Microsoft recommend to Authenticate the Application or Device which is going to send email.

I always recommend the customers to create one or several specific Office 365 Accounts with a Exchange Online license.This way you can set password never expire and choose a complex password with 16 characters.

Configure the Application or Device with the following settings:
SMTP Server:
Encryption/TLS: YES
Port: 587
And of course, make sure to enter the specific account under username and password.

Can I test the SMTP connection?

Of course you can test the connection and the credentials before you deploy this solution.
I’ve created a simple Powershell script that can test this:

$smtpcred = Get-Credential
Send-MailMessage –From –To –Subject “Testing SMTP” –Body “This email is sent from Office365 SMTP server for test purpose” -SmtpServer -Credential $smtpcred -UseSsl -Port 587

This script can come in handy when some customer call you to report that the email from the Applications/Devices isn’t working correctly. You can test the connection and the credentials easily.
Make sure that you change the mail-addresses, the Subject and Body after your needs.

not all application and devices have support for TLS and or to use specific credentials when sending mail through smtp servers.
To solve this, you might need to install a SMTP relay server in your server-infrastructure.


For more informations about other solutions and limits, visit Technet