SaslMechanismTryCreate(String, Encoding, NetworkCredential, SaslMechanism) Method

Try to 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 bool TryCreate(
	string mechanism,
	Encoding encoding,
	NetworkCredential credentials,
	out SaslMechanism?? sasl
)

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.
sasl  SaslMechanism
The SASL mechanism if supported; otherwise, .

Return Value

Boolean
if the SASL mechanism is supported; otherwise, .

Remarks

Tries to create an instance of the specified SASL mechanism using the supplied credentials.

Exceptions

ArgumentNullException

mechanism is .

-or-

encoding is .

-or-

credentials is .

See Also