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

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public AuthenticationMethods GetSupportedAuthMethods()

Return Value

Type: AuthenticationMethods
A set of flags indicating which authentication methods are supported by the server, or None if Hello method has not yet been called or if the server does not support EHLO command (i.e. the server is not ESMTP enabled).
Exceptions
ExceptionCondition
MailBeeInvalidStateExceptionThere are multiple or non-SMTP connections being opened at the moment (IsSmtpContext is false).
Examples
This sample lists all authentication methods supported by the SMTP server. SMTP servers do not support non-SASL methods, thus only SASL methods are checked.
// To use the code below, import these namespaces at the top of your code.
using System;
using MailBee;
using MailBee.SmtpMail;

// The actual code (put it into a method of your class)

Smtp mailer = new Smtp();
mailer.SmtpServers.Add("mail.domain.com");
mailer.Connect();
mailer.Hello();

AuthenticationMethods methods = mailer.GetSupportedAuthMethods();
if ( (methods & AuthenticationMethods.SaslLogin) > 0)
{
    Console.WriteLine("SASL LOGIN");
}
if ( (methods & AuthenticationMethods.SaslPlain) > 0)
{
    Console.WriteLine("SASL PLAIN");
}
if ( (methods & AuthenticationMethods.SaslCramMD5) > 0)
{
    Console.WriteLine("SASL CRAM-MD5 (secure)");
}

mailer.Disconnect();
See Also