Click or drag to resize
MimeKit

SaslMechanismCreate(String, Encoding, NetworkCredential) Method

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

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

Parameters

mechanism  String
The name of the SASL mechanism.
encoding  Encoding
The text encoding to use for the credentials.
credentials  NetworkCredential
The user's credentials.

Return Value

SaslMechanism
An instance of the requested SASL mechanism if supported; otherwise null.
Exceptions
ExceptionCondition
ArgumentNullException

mechanism is null.

-or-

encoding is null.

-or-

credentials is null.

Remarks
If unsure that a particular SASL mechanism is supported, you should first call IsSupported(String).
See Also