Smtp ClientGet Size Async Method
Asynchronously get the size of the message.
Definition
Namespace: MailKit.Net.Smtp
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
The size of the message, in bytes.
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
protected virtual Task<long> GetSizeAsync(
FormatOptions options,
MimeMessage message,
CancellationToken cancellationToken
)Parameters
- options FormatOptions
- The formatting options.
- message MimeMessage
- The message.
- cancellationToken CancellationToken
- The cancellation token.
Return Value
TaskInt64The 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 TransferProgress is non-null.
- The SMTP server supports the CHUNKING extension.