ImapLogin Method (String, String, AuthenticationMethods) |
Namespace: MailBee.ImapMail
Exception | Condition |
---|---|
MailBeeException | An error occurred and ThrowExceptions is true. |
Authentication methods are tried from more secure to less secure. If authMethods is set to Auto, MailBee will try to use the most secure 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.
To use OAuth 2.0 authentication (XOAUTH2 in Gmail and Office 365), see explanations and the example in OAuth2 topic.
// 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@domain.com", "secret", AuthenticationMethods.SaslCramMD5 | AuthenticationMethods.SaslNtlm); imp.Disconnect();