SMTP sending email unsuccessful

SimSouls Group Notifications 20 Reputation points
2023-06-02T14:58:13.3666667+00:00

I have exchange online account

there I have one email user and in that I have enabled SMTP AUTH,

so from my nodejs app

 domain: 'smtp.office365.com',
        port: '25',
        fromEmail: 'email',
        password: 'pass'

I am receiving following error

Invalid login: 535 5.7.3 Authentication unsuccessful.

and when I checked signin logs

I am getting this error: Access has been blocked by security defaults

I tried everything but seems like nothing is working.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,374 questions
Microsoft Exchange
Microsoft Exchange
Microsoft messaging and collaboration software.
455 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 56,206 Reputation points
    2023-06-03T03:38:25.84+00:00

    Hello,

    SMTP has since been depreciated by default (security defaults). You will need to utilize OAuth 2.0 as seen in the article cited below.

    We've already started making this change. We now create new Microsoft 365 tenants with Basic authentication in Exchange Online turned off, because Security defaults is enabled for them.

    Cited from https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online

    Authenticate an IMAP, POP or SMTP connection using OAuth

    https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth


    If this is helpful please accept answer.

    0 comments No comments

0 additional answers

Sort by: Most helpful