Click or drag to resize
MimeKit

MimeMessageLoad Method (ParserOptions, String, CancellationToken)

Load a MimeMessage from the specified file.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public static MimeMessage Load(
	ParserOptions options,
	string fileName,
	CancellationToken cancellationToken = default
)

Parameters

options
Type: MimeKitParserOptions
The parser options.
fileName
Type: SystemString
The name of the file to load.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: MimeMessage
The parsed message.
Exceptions
ExceptionCondition
ArgumentNullException

options is null.

-or-

fileName is null.

ArgumentExceptionfileName is a zero-length string, contains only white space, or contains one or more invalid characters.
DirectoryNotFoundExceptionfileName is an invalid file path.
FileNotFoundException The specified file path could not be found.
UnauthorizedAccessException The user does not have access to read the specified file.
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 file at the given path, using the specified ParserOptions.
See Also