Click or drag to resize
MimeKit

MimeEntityWriteTo(FormatOptions, String, CancellationToken) Method

Write the MimeEntity to the specified file.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public void WriteTo(
	FormatOptions options,
	string fileName,
	CancellationToken cancellationToken = default
)

Parameters

options  FormatOptions
The formatting options.
fileName  String
The file.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Implements

IMimeEntityWriteTo(FormatOptions, String, CancellationToken)
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.
ObjectDisposedException The MimeEntity has been disposed.
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
Writes the entity to the specified file using the provided formatting options.
See Also