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,464 questions
Microsoft Exchange
Microsoft Exchange
Microsoft messaging and collaboration software.
510 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 57,231 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://video2.skills-academy.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://video2.skills-academy.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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.