Smtp ClientSend Command Method
Send a custom command to the SMTP server.
Definition
Namespace: MailKit.Net.Smtp
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
The command response.
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
protected SmtpResponse SendCommand(
string command,
CancellationToken cancellationToken = default
)Parameters
- command String
- The command.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
SmtpResponseThe command response.
Remarks
Sends a custom command to the SMTP server.
Exceptions
| ArgumentNullException | command is . |
| ObjectDisposedException | The SmtpClient has been disposed. |
| ServiceNotConnectedException | The SmtpClient is not connected. |
| OperationCanceledException | The operation has been canceled. |
| IOException | An I/O error occurred. |
| SmtpProtocolException | An SMTP protocol exception occurred. |