IMail ServiceDisconnect Method
Disconnect the service.
Definition
Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
void Disconnect(
bool quit,
CancellationToken cancellationToken = default
)Parameters
- quit Boolean
- If set to , a "QUIT" command will be issued in order to disconnect cleanly.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Remarks
Disconnects from the service.
If quit is , a "QUIT" command will be issued in order to disconnect cleanly.
Exceptions
| ObjectDisposedException | The IMailService has been disposed. |
| ServiceNotConnectedException | The IMailService is not connected. |
| OperationCanceledException | The operation was canceled via the cancellation token. |
| IOException | An I/O error occurred. |
| CommandException | The command was rejected by the mail server. |
| ProtocolException | The server responded with an unexpected token. |