Click or drag to resize
MimeKit

SmtpClientGetSizeAsync Method

Asynchronously get the size of the message.

Namespace:  MailKit.Net.Smtp
Assembly:  MailKit (in MailKit.dll) Version: 2.3.0
Syntax
C#
protected virtual Task<long> GetSizeAsync(
	FormatOptions options,
	MimeMessage message,
	CancellationToken cancellationToken
)

Parameters

options
Type: MimeKitFormatOptions
The formatting options.
message
Type: MimeKitMimeMessage
The message.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: TaskInt64
The size of the message, in bytes.
Remarks

Asynchronously calculates the size of the message in bytes.

This method is called by SendAsync methods in the following conditions:

  • The SMTP server supports the SIZE= parameter in the MAIL FROM command.
  • The ITransferProgress parameter is non-null.
  • The SMTP server supports the CHUNKING extension.
See Also