MapiMessage.SaveAsync

SaveAsync(string, CancellationToken)

Saves this MapiMessage to the specified file asynchronously.

public Task SaveAsync(string fileName, CancellationToken token = default)
ParameterTypeDescription
fileNameStringThe name of the file to save the message to.
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentExceptionfileName is null or empty.

See Also


SaveAsync(string, SaveOptions, CancellationToken)

Saves this MapiMessage to the specified file with specified options asynchronously.

public Task SaveAsync(string fileName, SaveOptions options, CancellationToken token = default)
ParameterTypeDescription
fileNameStringThe name of the file to save the message to.
optionsSaveOptionsOptions for saving message.
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentExceptionfileName is null or empty.
ArgumentNullExceptionoptions is null.

See Also


SaveAsync(Stream, CancellationToken)

Saves this MapiMessage to the specified stream asynchronously.

public Task SaveAsync(Stream stream, CancellationToken token = default)
ParameterTypeDescription
streamStreamThe stream to save the message to.
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentNullExceptionstream is null.
NotSupportedExceptionstream does not support writing.

See Also


SaveAsync(Stream, SaveOptions, CancellationToken)

Saves this MapiMessage to the specified stream with specified options asynchronously.

public Task SaveAsync(Stream stream, SaveOptions options, CancellationToken token = default)
ParameterTypeDescription
streamStreamThe stream to save the message to.
optionsSaveOptionsOptions for saving message.
tokenCancellationTokenPropagates notification that operations should be canceled.

Exceptions

exceptioncondition
ArgumentNullExceptionstream is null.
NotSupportedExceptionstream does not support writing.
ArgumentNullExceptionoptions is null.

See Also