+1 vote

I am trying to connect office365 account and it is giving this error "-ERR Logon failure: unknown user name or bad password." although user name and password both are correct.


1 Answer

0 votes

For Office 365 you should use OAuth 2.0 flows, as Microsoft disabled basic authentication for company accounts:

Microsoft does not allow app-passwords for company accounts.
For other accounts (@hotmail.com) app-passwords still work:

Also make sure IMAP/POP3 are enabled (this is very important):

by (298k points)
edited by