MailServiceDisconnectAsync Method

Asynchronously disconnect the service.

Definition

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public abstract Task DisconnectAsync(
	bool quit,
	CancellationToken cancellationToken = default
)

Parameters

quit  Boolean
If set to , a logout/quit command will be issued in order to disconnect cleanly.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

Task
An asynchronous task context.

Implements

IMailServiceDisconnectAsync(Boolean, CancellationToken)

Remarks

If quit is , a logout/quit command will be issued in order to disconnect cleanly.

Exceptions

ObjectDisposedException The MailService has been disposed.

See Also