ImapLogin Method (String, String) |
Namespace: MailBee.ImapMail
Exception | Condition |
---|---|
MailBeeException | An error occurred and ThrowExceptions is true. |
This method will try to authenticate using the best (the most secure) authentication method supported by the server, but will downgrade to less secure methods (to the simplest "LOGIN account password" authentication in the worst case) if better methods are not available.
You can also force using a particular authentication method with Login(String, String, AuthenticationMethods) overload passing a method like Regular.
![]() |
---|
If SafeMode is true, MailBee will use the simplest "LOGIN account password" authentication by default (Regular option). This can often help to troubleshoot login problems (some mail servers implement secure authentication methods incorrectly). |
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.ImapMail; // The actual code (put it into a method of your class). Imap imp = new Imap(); imp.Connect("mail.domain.com"); imp.Login("jdoe", "secret"); imp.SelectFolder("INBOX"); Console.WriteLine(imp.MessageCount + " message(s) in inbox"); imp.Disconnect();