Click or drag to resize
MimeKit

SmtpClientNoOpAsync Method

Asynchronously ping the SMTP server to keep the connection alive.

Namespace: MailKit.Net.Smtp
Assembly: MailKit (in MailKit.dll) Version: 4.3.0
Syntax
C#
public override Task NoOpAsync(
	CancellationToken cancellationToken = default
)

Parameters

cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

Task
An asynchronous task context.

Implements

IMailServiceNoOpAsync(CancellationToken)
IMailServiceNoOpAsync(CancellationToken)
Exceptions
ExceptionCondition
ObjectDisposedException The SmtpClient has been disposed.
ServiceNotConnectedException The SmtpClient is not connected.
OperationCanceledException The operation was canceled.
IOException An I/O error occurred.
SmtpCommandException The SMTP command failed.
SmtpProtocolException An SMTP protocol error occurred.
Remarks
Mail servers, if left idle for too long, will automatically drop the connection.
See Also