Click or drag to resize
MimeKit

MimeMessageLoadAsync Method (ParserOptions, Stream, CancellationToken)

Asynchronously load a MimeMessage from the specified stream.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public static Task<MimeMessage> LoadAsync(
	ParserOptions options,
	Stream stream,
	CancellationToken cancellationToken = default
)

Parameters

options
Type: MimeKitParserOptions
The parser options.
stream
Type: System.IOStream
The stream.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: TaskMimeMessage
The parsed message.
Exceptions
ExceptionCondition
ArgumentNullException

options is null.

-or-

stream is null.

OperationCanceledException The operation was canceled via the cancellation token.
FormatException There was an error parsing the entity.
IOException An I/O error occurred.
Remarks
Loads a MimeMessage from the given stream, using the specified ParserOptions.
See Also