Pop3Login Method (String, String, AuthenticationMethods)
Logs in a mailbox on the POP3 server.

Namespace: MailBee.Pop3Mail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public bool Login(
	string accountName,
	string password,
	AuthenticationMethods authMethods
)

Parameters

accountName
Type: SystemString
The user account name on the server.
password
Type: SystemString
The password of the user account on the server.
authMethods
Type: MailBeeAuthenticationMethods
A set of authentication methods which can be used when logging in a mailbox.

Return Value

Type: Boolean
true if a login attempt succeeded; otherwise, false.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks
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.
Examples
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.
// 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();
See Also