Unable to get SMTP working with M365

Unable to get SMTP working with M365

- Jonathan Aquilina の投稿
返信数: 3

Good Morning,

I have found the below post

https://moodle.org/mod/forum/discuss.php?d=410567&mode=2

I have tried to replicate the settings, but I have matched the settings as per the above post but nothing works.

Our tenant has MFA enabled so I have on a particular user enabled Authenticated SMTP and an app password on one of my users as well as a connector to allow traffic from the servers ip to use the SMTP relay.

I am on moodle 4.4+

I am not sure why these settings arent working as I have this same kind of setup being used on another M365 tenant and with different software and its working as it should be.

Any help would be greatly appreciated.

Jonathan Aquilina への返信

Re: Unable to get SMTP working with M365

- Visvanath Ratnaweera の投稿
画像 Particularly helpful Moodlers 画像 Translators
Not a Windows person, but since nobody replied, trying from first principles.

  • SMTP hosts = smtp.office365.com:587
  • Security = TLS
  • Auth type = LOGIN
  • SMTP username = same as support email
  • Pass = the password
But nothing works. How does "nothing works" look like. Something freezes or screens go white or throws errors?

- Did you try yoursite/admin/testoutgoingmailconf.php ?

I'm not sure whether Debugging logs the SMTP dialog. There was a third-party plug-in to get the full trace of the SMTP dialog.

- Dumb question: Did you check for firewall issues? This is what I see on my laptop:



P.S. All that said, notice that the post you are following is almost 4 years old. Unlike the Internet standards (RFCs and all) the services from the BIG are completely in their hands. The make and shake them at their will. Hope a Windows colleague will confirm that the post is still valid, or come with a newer tutorial.

Visvanath Ratnaweera への返信

Re: Unable to get SMTP working with M365

- Jonathan Aquilina の投稿
Hi Thanks for this feedback.

I am using the M365 App password on my mail account the support email we have setup is a shared mailbox.
 
I have the settings exactly as you show, but to no avail

When I run the testoutgoingmailconf.php it gives me an error - Your site couldn't communicate with your mail server. Please check your outgoing mail configuration.

firewall is fine here.