Click or drag to resize
MimeKit

SmtpClientSendCommand Method

Send a custom command to the SMTP server.

Namespace: MailKit.Net.Smtp
Assembly: MailKit (in MailKit.dll) Version: 4.3.0
Syntax
C#
protected SmtpResponse SendCommand(
	string command,
	CancellationToken cancellationToken = default
)

Parameters

command  String
The command.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

SmtpResponse
The command response.
Exceptions
ExceptionCondition
ArgumentNullExceptioncommand is null.
ObjectDisposedException The SmtpClient has been disposed.
ServiceNotConnectedException The SmtpClient is not connected.
OperationCanceledException The operation has been canceled.
IOException An I/O error occurred.
SmtpCommandException The SMTP command failed.
SmtpProtocolException An SMTP protocol exception occurred.
Remarks

Sends a custom command to the SMTP server.

Note  Note
The command string should not include the terminating \r\n sequence.
See Also