+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.

by

1 Answer

0 votes

For Office 365 you should use OAuth 2.0 flows, as Microsoft disabled basic authentication for company accounts:
https://www.limilabs.com/blog/office-365-basic-auth-is-disabled

Microsoft does not allow app-passwords for company accounts.
For other accounts (@hotmail.com) app-passwords still work:
https://www.limilabs.com/blog/office365-app-passwords

Also make sure IMAP/POP3 are enabled (this is very important):
https://www.limilabs.com/blog/office365-enable-imap-pop3-smtp

by (297k points)
edited by
...