Office 365 SMTP authentication failing, even with correct account information

Anonymous
2020-02-10T16:38:43+00:00

On my Wordpress site I've run into a problem in the last day or so, where emails simply fail to send. Before today it was running flawlessly for two months. The account information/password/username etc have not changed in that two months.

I'm using a Wordpress plugin called WP Mail SMTP to facilitate the sending of all outgoing emails. The error log I'm getting from the email test on that is as follows:

Versions:

WordPress: 5.3.2

WordPress MS: No

PHP: 7.3.14-5+0~20200202.52+debian9~1.gbpa71879

WP Mail SMTP: 1.8.1

Params:

Mailer: smtp

Constants: No

ErrorInfo: SMTP Error: Could not authenticate.

Host: smtp.office365.com

Port: 587

SMTPSecure: tls

SMTPAutoTLS: bool(true)

SMTPAuth: bool(true)

Server:

OpenSSL: OpenSSL 1.1.1d 10 Sep 2019

SMTP Debug:

2020-02-10 16:36:56 Connection: opening to smtp.office365.com:587, timeout=300, options=array ()

2020-02-10 16:36:56 Connection: opened

2020-02-10 16:36:56 SERVER -> CLIENT: 220 LNXP123CA0008.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 10 Feb 2020 16:36:55 +0000

2020-02-10 16:36:56 CLIENT -> SERVER: EHLO www.*****.com

2020-02-10 16:36:56 SERVER -> CLIENT: 250-LNXP123CA0008.outlook.office365.com Hello [***]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8

2020-02-10 16:36:56 CLIENT -> SERVER: STARTTLS

2020-02-10 16:36:56 SERVER -> CLIENT: 220 2.0.0 SMTP server ready

2020-02-10 16:36:56 CLIENT -> SERVER: EHLO www.zestpromotional.com

2020-02-10 16:36:56 SERVER -> CLIENT: 250-LNXP123CA0008.outlook.office365.com Hello [***]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN XOAUTH2250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8

2020-02-10 16:36:56 CLIENT -> SERVER: AUTH LOGIN

2020-02-10 16:36:56 SERVER -> CLIENT: 334 VXNlcm5hbWU6

2020-02-10 16:36:56 CLIENT -> SERVER: c2FsZXNAemVzdHByb21vdGlvbmFsLmNvbQ==

2020-02-10 16:36:56 SERVER -> CLIENT: 334 UGFzc3dvcmQ6

2020-02-10 16:36:56 CLIENT -> SERVER: QmFkMzM4MzA=

2020-02-10 16:37:02 SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful [LNXP123CA0008.GBRP123.PROD.OUTLOOK.COM]

2020-02-10 16:37:02 SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [LNXP123CA0008.GBRP123.PROD.OUTLOOK.COM]

SMTP Error: Could not authenticate.

2020-02-10 16:37:02 CLIENT -> SERVER: QUIT

2020-02-10 16:37:02 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel

2020-02-10 16:37:02 Connection: closed

SMTP Error: Could not authenticate.

Does anyone have any ideas at all? I'm completely at a loss here.

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

48 answers

Sort by: Most helpful
  1. Anonymous
    2020-12-15T10:27:29+00:00

    I have checked everything outlined here and i still have the issue

    -Modern auth is off

    -SmtpClientAuthenticationDisabled $false

    -User SMTP is ticked

    -Security defaults is off

    The worst part is i went over all this then it worked last week, then a week later with no tenant changes it is not working

    As a last ditch i toggled all the settings encase they were displaying incorrectly or some such and it still won't work.

    I have also created a brand new user and applied the relevant settings and it also does not work.

    Side note when enabling 2 factor App passwords cannot be created even tho the option is on, and there are no policy's preventing it as polices aren't available in the license.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2021-02-24T23:58:07+00:00

    I was struggling with that too. Finally I found a solution which requires to change properties in Azure Active Directory (Properties > Manage Security Defaults). You have to turn off "Enable Security defaults" like at the linked screenshot from the documentation.

    The starting point to find that solution was **Microsoft 365 Admin Center > Settings > Org settings > Services > Modern authentication.**The link to the above mentioned documentation is provided in description of Modern authentication.

    Now I'm able to send emails by SMTP protocol with using an app password from MFA enabled account.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-10-24T17:45:41+00:00

    @all i think this ist the solution:

    I had the same Problems, old offic365 accounts work, new accounts did not work. After searching for 5 hours i get a solution:

    In the old accounts SmtpClientAuthenticationDisabled is false by default on online Exchange, in the new accounts it is True by default.

    I had to set it to false by exchange online powershell and also hat do go to e-mail-apps and set the hook to authenticated smtp

    after that it worked. Here you can read what is to do by exchange powershell:

    https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission

    Steps in Powershell:

    $UserCredential = Get-Credential

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

    Import-PSSession $Session -DisableNameChecking

    Take a look if it is True: Get-TransportConfig  (if there is True set to false)

    Set-TransportConfig -SmtpClientAuthenticationDisabled $false

    Take a look again if it works: Get-TransportConfig

    Remove-PSSession $Session

    In Admin Center --> acitve Users --> click the user --> email-apps --> click the hook --> authenticated smtp

    With this combination it worked for me. Hope this can help you all

    This was exactly what I was looking for, it was hard to find. I would like to add that in my case, I had to not only do this but also do it at the user account explicitly because it had already been created with the previous global defaults. Thanks a lot.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2020-06-25T17:28:48+00:00

    Same issue here. We've got a phone server sending VM's to email using SMTP. We have successfully tested authenticating through OWA, but VM to email is no longer working. Has anyone made any progress on this?

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2020-06-11T05:36:52+00:00

    I am also getting authentication issues. I am able to log onto the web app with the same credentials.

    I tried using OSX email app, Spark, and it will not work.  I am trying to also send email via PHP using 'PHPMailer' as well as "Pear Mail'. 

    nothing seems to work. Is there something that needs to be enabled on outlook.live.com???

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments