ImapGetSupportedAuthMethods Method |
Returns a set of flags indicating which authentication methods are supported by the server.
Namespace: MailBee.ImapMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public AuthenticationMethods GetSupportedAuthMethods()
Public Function GetSupportedAuthMethods As AuthenticationMethods
Return Value
Type:
AuthenticationMethodsA set of flags indicating which authentication methods are supported by the server.
Exceptions Remarks If the IMAP4 server advertises LOGINDISABLED capability, regular authentication
may not be supported by the server. However, this often indicates the client should call
StartTls method to establish TLS/SSL secure connection. After that,
regular authentication option will become available.
Examples This sample indicates whether NTLM authentication (also known as Secure Password Authentication - SPA) is supported by the server.
using MailBee;
using MailBee.ImapMail;
Imap imp = new Imap();
imp.Connect("mail.domain.com");
AuthenticationMethods authMethods = imp.GetSupportedAuthMethods();
if ((authMethods & AuthenticationMethods.SaslNtlm) > 0)
{
Console.WriteLine("NTLM secure authentication (SPA) is supported");
}
else
{
Console.WriteLine("The IMAP4 server does not support NTLM (SPA)");
}
imp.Disconnect();
Imports MailBee
Imports MailBee.ImapMail
Dim imp As New Imap
imp.Connect("mail.domain.com")
Dim authMethods As AuthenticationMethods = imp.GetSupportedAuthMethods()
If ((authMethods And AuthenticationMethods.SaslNtlm) > 0) Then
Console.WriteLine("NTLM secure authentication (SPA) is supported")
Else
Console.WriteLine("The IMAP4 server does not support NTLM (SPA)")
End If
imp.Disconnect()
See Also