535 5.7.3 Authentication unsuccessful Error with office 365

Viewed 8482

I am using javamail, O365 and it worked until I set multifactor authentication in O365. Now it has 535 5.7.3 Authentication unsuccessful Error.

How can I use Javamail when the email account has to be authoroized by phone?

javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [SL2P216CA0096.KORP216.PROD.OUTLOOK.COM]

    at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:826)
    at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:761)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:685)
    at javax.mail.Service.connect(Service.java:317)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)

This is the account's access list. This is the account's access list.

1 Answers

You need to create an "Office 365 App Password", described for example here

It might be that it is not available to you, from above link:

Your administrator may not allow you to use app passwords. If you don't see App passwords as an option, they're not available in your organization.

Related