Click or drag to resize
MimeKit

IMailTransportSendAsync(MimeMessage, CancellationToken, ITransferProgress) Method

Asynchronously send the specified message.

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 4.3.0
Syntax
C#
Task<string> SendAsync(
	MimeMessage message,
	CancellationToken cancellationToken = default,
	ITransferProgress progress = null
)

Parameters

message  MimeMessage
The message.
cancellationToken  CancellationToken  (Optional)
The cancellation token.
progress  ITransferProgress  (Optional)
The progress reporting mechanism.

Return Value

TaskString
The final free-form text response from the server.
Remarks

Asynchronously sends the specified message.

The sender address is determined by checking the following message headers (in order of precedence): Resent-Sender, Resent-From, Sender, and From.

If either the Resent-Sender or Resent-From addresses are present, the recipients are collected from the Resent-To, Resent-Cc, and Resent-Bcc headers, otherwise the To, Cc, and Bcc headers are used.

See Also