|  | Imap | 
 Syntax
Syntaxpublic override Task AuthenticateAsync( SaslMechanism mechanism, CancellationToken cancellationToken = default )
 Exceptions
Exceptions| Exception | Condition | 
|---|---|
| ArgumentNullException | mechanism is . | 
| ObjectDisposedException | The ImapClient has been disposed. | 
| ServiceNotConnectedException | The ImapClient is not connected. | 
| InvalidOperationException | The ImapClient is already authenticated. | 
| OperationCanceledException | The operation was canceled via the cancellation token. | 
| AuthenticationException | Authentication using the supplied credentials has failed. | 
| SaslException | A SASL authentication error occurred. | 
| IOException | An I/O error occurred. | 
| ImapCommandException | An IMAP command failed. | 
| ImapProtocolException | An IMAP protocol error occurred. | 
 Remarks
RemarksAuthenticates using the specified SASL mechanism.
For a list of available SASL authentication mechanisms supported by the server, check the AuthenticationMechanisms property after the service has been connected.
 See Also
See Also