Click or drag to resize
MimeKit

MimeEntityLoadAsync Method (String, CancellationToken)

Asynchroinously load a MimeEntity from the specified file.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 3.0.0
Syntax
C#
public static Task<MimeEntity> LoadAsync(
	string fileName,
	CancellationToken cancellationToken = default
)

Parameters

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

Return Value

Type: TaskMimeEntity
The parsed entity.
Exceptions
ExceptionCondition
ArgumentNullExceptionfileName 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 MimeEntity from the file at the give file path, using the default ParserOptions.
See Also