Click or drag to resize
MimeKit

IMailTransportSendAsync Method (FormatOptions, MimeMessage, CancellationToken, ITransferProgress)

Asynchronously send the specified message.

Namespace:  MailKit
Assembly:  MailKit (in MailKit.dll) Version: 2.3.0
Syntax
C#
Task SendAsync(
	FormatOptions options,
	MimeMessage message,
	CancellationToken cancellationToken = null,
	ITransferProgress progress = null
)

Parameters

options
Type: MimeKitFormatOptions
The formatting options.
message
Type: MimeKitMimeMessage
The message.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.
progress (Optional)
Type: MailKitITransferProgress
The progress reporting mechanism.

Return Value

Type: Task
An asynchronous task context.
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