MailServiceNoOpAsync Method

Asynchronously ping the mail server to keep the connection alive.

Definition

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

Parameters

cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

Task
An asynchronous task context.

Implements

IMailServiceNoOpAsync(CancellationToken)

Remarks

Mail servers, if left idle for too long, will automatically drop the connection.

Exceptions

ObjectDisposedException The MailService has been disposed.
InvalidOperationException

The MailService is not connected.

-or-

The MailService is not authenticated.

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.

See Also