Office 365 SMTP server doesn't work for outgoing email [SOLVED]

Office 365 SMTP server doesn't work for outgoing email [SOLVED]

by Mosaab Alsiddig -
Number of replies: 0

I did everything well
From site administration - server - Outgoing mail configuration I setup :
SMTP hosts: smtp.office365.com:587
SMTP security: TLS
SMTP username: moodle@example.com
SMTP password: password
No-reply address: moodle@example.com

Then I installed "Moodle eMail Test" plugin and try to send a message
The result is failed 😟



I keep searching here, in google and discussing all possible defects with Microsoft support
At the end we figure out the solution and I would like to share in case if anyone find himself in a such situation

The problem was: SMTP auth is disabled for the tenant
Solution:
* from search box beside start button in your computer write "PowerShell" and open windows PowerShell as administrator
* Connect to exchange online using PowerShell using commands:

Install-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName USER@EXAMPLE.COM -ShowProgress $true  

Change user@example.com to your admin email, then run:

 Set-CASMailbox -Identity moodle@example.com -SmtpClientAuthenticationDisabled $false

Do not forget to change (moodle@example.com) to your outgoing email
That's all 🙂

it works for me and I hope it does for you

Average of ratings: Useful (1)