–1 vote

Getting exception "AUTHENTICATE failed." while connecting imap can anyone pls help

using (Imap imap = new Imap())
    imap.UseBestLogin(Email, AppPassword);



1 Answer

0 votes

There are several reasons why your server is refusing to authenticate you.

Most common are:

  • Invalid username or password.
  • IMAP protocol being turned off for this account.
  • OAuth 2.0 is required instead of username/password authentication scheme.
  • OAuth 2.0 is required instead of username/app password authentication scheme.

Depending on the email provider your options and solutions differ greatly.

If you are using Office365 (error message suggests that) go here:

For other providers you may want to browse samples here:

by (298k points)