Set the app password to the office365-outlook email and getting the 'Authentication failed' exception even with this app password, on using the UseBestLogin() method with Imap protocol
There is very little detail provided in your question:
What email server/vendor are you using (Gmail, Office365, Exchange, Yahoo)? What protocol are you using (IMAP, SMTP, POP3)? How does your code look like? Are you using SSL/TLS? Do you have any logs?
Remember that for Gmail you need to turn 2-Step verification on, to use App passwords: https://www.limilabs.com/blog/using-app-passwords-with-gmail