SaslMechanismTryCreate(String, 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,
	NetworkCredential credentials,
	out SaslMechanism?? sasl
)

Parameters

mechanism  String
The name of the SASL mechanism.
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-

credentials is .

See Also