Attempting to use O365 SMTP server can be frustrating. You will find the following settings everywhere on the internet:
- Server Address: smtp.office365.com
- Username: Your Office 365 Address (e.g. [email protected])
- Password: Your Office 365 Password
- Port Number: 587 (With TLS)
- Authentication: Required
- Sending Limits: 10,000 Emails a day
What you wont find, is that by default O365 disables SMTP servers and needs to be enabled via powershell.
To do this, first download Exchange Powershell here
In powershell, connect to your O365
Connect-ExchangeOnline -UserPrincipalName <your email>
You can test to see if your SMTP server is disabled with this command:
Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled
If is disabled it will show:
SmtpClientAuthenticationDisabled : True
To enable, write the following command:
Set-TransportConfig -SmtpClientAuthenticationDisabled $false
You’re O365 SMTP server will now work!