Logs in a mailbox on the POP3 server.
true if a login attempt succeeded; otherwise, false.
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 USER/PASS authentication in the worst case) if better methods are not available.
| Exception Type | Condition |
|---|---|
| MailBeeException | An error occurred and ThrowExceptions is true. |
This sample connects to a POP3 server and logs in a user account using secure authentication methods only. Use of insecure methods is not allowed.
[C#] // To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Pop3Mail; // The actual code (put it into a method of your class). Pop3 pop = new Pop3(); pop.Connect("mail.domain.com"); pop.Login("jdoe", "secret", AuthenticationMethods.Apop | AuthenticationMethods.SaslCramMD5 | AuthenticationMethods.SaslNtlm); pop.Disconnect();
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.Pop3Mail ' The actual code (put it into a method of your class). Dim pop As New Pop3 pop.Connect("mail.domain.com") pop.Login("jdoe", "secret", _ AuthenticationMethods.Apop Or AuthenticationMethods.SaslCramMD5 Or AuthenticationMethods.SaslNtlm) pop.Disconnect()
Pop3 Class | MailBee.Pop3Mail Namespace | Pop3.Login Overload List