Mime EntityWrite To Async(Stream, Cancellation Token) Method
Asynchronously write the MimeEntity to the specified output stream.
Definition
Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
An awaitable task.
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public Task WriteToAsync(
Stream stream,
CancellationToken cancellationToken = default
)Parameters
- stream Stream
- The output stream.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
TaskAn awaitable task.
Implements
IMimeEntityWriteToAsync(Stream, CancellationToken)Remarks
Asynchronously writes the entity to the output stream.
Exceptions
| ArgumentNullException | stream is . |
| ObjectDisposedException | The MimeEntity has been disposed. |
| OperationCanceledException | The operation was canceled via the cancellation token. |
| IOException | An I/O error occurred. |