MailBee.NET Objects 4.0

Pop3.GetSupportedAuthMethods Method 

Returns a set of flags indicating which authentication methods are supported by the server.

public AuthenticationMethods GetSupportedAuthMethods();

Return Value

A set of flags indicating which authentication methods are supported by the server.

Remarks

This method performs round-trip to the server only if the list of authentication methods has not already been downloaded. Since this list is a part of the server capabilities, it will already be available in the local cache if the server capabilities have already been downloaded during this connection (for instance, due to GetExtensions method call). If the list of supported authentication methods is already available in the local cache, this method will immediately return the cached results.

Note   If the POP3 server does not support CAPA command and the client already logged in the mailbox, it's not possible to get the list of supported authentication methods (unless it has already been downloaded prior to logging in). This is because AUTH command (which returns the list of authentication methods available) cannot be issued once the client has logged in.

Exceptions

Exception Type Condition
MailBeeException An error occurred and ThrowExceptions is true.

Example

This sample indicates whether APOP authentication is supported by the server.

[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");
AuthenticationMethods authMethods = pop.GetSupportedAuthMethods();

if ((authMethods & AuthenticationMethods.Apop) > 0)
{
    Console.WriteLine("APOP secure authentication is supported");
}
else
{
    Console.WriteLine("The POP3 server does not support APOP");
}
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")
Dim authMethods As AuthenticationMethods = pop.GetSupportedAuthMethods()

If ((authMethods And AuthenticationMethods.Apop) > 0) Then
    Console.WriteLine("APOP secure authentication is supported")
Else
    Console.WriteLine("The POP3 server does not support APOP")
End If
pop.Disconnect()

See Also

Pop3 Class | MailBee.Pop3Mail Namespace | GetExtensions