MapiMessage.LoadAsync
Contents
[
Hide
]LoadAsync(string, CancellationToken)
Loads a MapiMessage from the specified file asynchronously.
public static Task<MapiMessage> LoadAsync(string fileName, CancellationToken token = default)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | The name of the file to load the message from. |
| token | CancellationToken | Propagates notification that operations should be canceled. |
Return Value
Returns a MapiMessage instance loaded from the specified file.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | fileName is null or empty. |
| FileNotFoundException | The specified file does not exist. |
See Also
- class MapiMessage
- namespace Aspose.Email.Mapi
- assembly Aspose.Email
LoadAsync(Stream, CancellationToken)
Loads a MapiMessage from the specified stream asynchronously.
public static Task<MapiMessage> LoadAsync(Stream stream, CancellationToken token = default)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | The stream to load the message from. |
| token | CancellationToken | Propagates notification that operations should be canceled. |
Return Value
Returns a MapiMessage instance loaded from the specified stream.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | stream is null. |
| NotSupportedException | stream does not support reading. |
See Also
- class MapiMessage
- namespace Aspose.Email.Mapi
- assembly Aspose.Email
LoadAsync(string, LoadOptions, CancellationToken)
Loads a MapiMessage from the specified file with specified options asynchronously.
public static Task<MapiMessage> LoadAsync(string fileName, LoadOptions options,
CancellationToken token = default)
| Parameter | Type | Description |
|---|---|---|
| fileName | String | The name of the file to load the message from. |
| options | LoadOptions | Options for loading message. If null, the format is detected from the data: an MSG is loaded with MsgLoadOptions, anything else with EmlLoadOptions. |
| token | CancellationToken | Propagates notification that operations should be canceled. |
Return Value
Returns a MapiMessage instance loaded from the specified file.
Exceptions
| exception | condition |
|---|---|
| ArgumentException | fileName is null or empty. |
| FileNotFoundException | The specified file does not exist. |
See Also
- class LoadOptions
- class MapiMessage
- namespace Aspose.Email.Mapi
- assembly Aspose.Email
LoadAsync(Stream, LoadOptions, CancellationToken)
Loads a MapiMessage from the specified stream with specified options asynchronously.
public static Task<MapiMessage> LoadAsync(Stream stream, LoadOptions options,
CancellationToken token = default)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | The stream to load the message from. |
| options | LoadOptions | Options for loading message. If null, the format is detected from the data: an MSG is loaded with MsgLoadOptions, anything else with EmlLoadOptions. |
| token | CancellationToken | Propagates notification that operations should be canceled. |
Return Value
Returns a MapiMessage instance loaded from the specified stream.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | stream is null. |
| NotSupportedException | stream does not support reading. |
See Also
- class LoadOptions
- class MapiMessage
- namespace Aspose.Email.Mapi
- assembly Aspose.Email