Sasl MechanismCreate(String, Encoding, Network Credential) 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
An instance of the requested SASL mechanism.
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
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
SaslMechanismAn 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, Encoding, NetworkCredential, SaslMechanism) instead.
Exceptions
| ArgumentNullException |
mechanism is . -or- encoding is . -or- credentials is . |
| NotSupportedException | The specified SASL mechanism is not supported. |