SaslMechanismCreate(String, NetworkCredential) Method

Create an instance of the specified SASL mechanism using the supplied credentials.

Definition

Namespace: MailKit.Security
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public static SaslMechanism Create(
	string mechanism,
	NetworkCredential credentials
)

Parameters

mechanism  String
The name of the SASL mechanism.
credentials  NetworkCredential
The user's credentials.

Return Value

SaslMechanism
An instance of the requested SASL mechanism.

Remarks

If unsure that a particular SASL mechanism is supported, you should first call IsSupported(String) or use TryCreate(String, NetworkCredential, SaslMechanism) instead.

Exceptions

ArgumentNullException

mechanism is .

-or-

credentials is .

NotSupportedException The specified SASL mechanism is not supported.

See Also