Click or drag to resize
MimeKit

MimeEntityWriteToAsync Method (FormatOptions, String, CancellationToken)

Asynchronously write the MimeEntity to the specified file.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.3.0
Syntax
C#
public Task WriteToAsync(
	FormatOptions options,
	string fileName,
	CancellationToken cancellationToken = null
)

Parameters

options
Type: MimeKitFormatOptions
The formatting options.
fileName
Type: SystemString
The file.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: Task
An awaitable task.
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 as defined by InvalidPathChars.
OperationCanceledException The operation was canceled via the cancellation token.
DirectoryNotFoundExceptionfileName is an invalid file path.
FileNotFoundException The specified file path could not be found.
UnauthorizedAccessException The user does not have access to write to the specified file.
IOException An I/O error occurred.
Remarks
Asynchronously writes the MimeEntity to the specified file using the provided formatting options.
See Also