|Pop3Login Method (String, String, String, String, AuthenticationMethods, AuthenticationOptions, SaslMethod)|
public bool Login( string targetName, string domain, string accountName, string password, AuthenticationMethods authMethods, AuthenticationOptions authOptions, SaslMethod authUserDefined )
Public Function Login ( targetName As String, domain As String, accountName As String, password As String, authMethods As AuthenticationMethods, authOptions As AuthenticationOptions, authUserDefined As SaslMethod ) As Boolean
By default, MailBee won't even try to use authentication methods which are not listed by the server in its capabilities. This behavior can be changed by setting TryUnsupportedMethods bit in authOptions. If, during the authentication attempt, the server reports that the method is unsupported, MailBee will try the next method in authMethods until the compatible method is found or no more methods left. This behavior can be changed by setting UseSingleMethodOnly bit in authOptions.
Authentication methods are tried from more secure to less secure. If authMethods is set to Auto and authOptions is None, 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.
// 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("", null, null, null, AuthenticationMethods.SaslGssApi, AuthenticationOptions.TryUnsupportedMethods, null); pop.Disconnect();
' 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("", Nothing, Nothing, Nothing, AuthenticationMethods.SaslGssApi, _ AuthenticationOptions.TryUnsupportedMethods, Nothing) pop.Disconnect()