Imap.GetMessageAsync Method
Namespace: Rebex.Net
Assembly: Rebex.Imap.dll (version 7.0.9119)
GetMessageAsync(Int32, Stream, Int64, Int32, Object)
Begins asynchronous GetMessage operation. Downloads the specified part of the message with the specified sequence number and writes its data into a supplied stream.
Declaration
public Task<long> GetMessageAsync(int sequenceNumber, Stream output, long remoteOffset, int length, object state = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sequenceNumber | Message sequence number. |
Stream | output | Stream that will receive the message. |
Int64 | remoteOffset | The starting offset of the message data to download. |
Int32 | length | Number of bytes to transfer or -1 to transfer all data until an end of message is reached. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
GetMessageAsync(String, Stream, Int64, Int32, Object)
Begins asynchronous GetMessage operation. Downloads the specified part of the message with the specified unique ID and writes its data into a supplied stream.
Declaration
public Task<long> GetMessageAsync(string uniqueId, Stream output, long remoteOffset, int length, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueId | Message unique ID. |
Stream | output | Stream that will receive the message. |
Int64 | remoteOffset | The starting offset of the message data to download. |
Int32 | length | Number of bytes to transfer or -1 to transfer all data until an end of message is reached. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
By default, this method marks the message as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
GetMessageAsync(Int32, Stream, Object)
Begins asynchronous GetMessage operation. Downloads the message with the specified sequence number and writes its data into a supplied stream.
Declaration
public Task<long> GetMessageAsync(int sequenceNumber, Stream output, object state = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sequenceNumber | Message sequence number. |
Stream | output | Stream that will receive the message. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
By default, this method marks the message as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
GetMessageAsync(String, Stream, Object)
Begins asynchronous GetMessage operation. Downloads the message with the specified unique ID and writes its data into a supplied stream.
Declaration
public Task<long> GetMessageAsync(string uniqueId, Stream output, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueId | Message unique ID. |
Stream | output | Stream that will receive the message. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
By default, this method marks the message as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
GetMessageAsync(Int32, String, Int64, Int32, Object)
Begins asynchronous GetMessage operation. Downloads the message with the specified sequence number and writes its data into a local file.
Declaration
public Task<long> GetMessageAsync(int sequenceNumber, string fileName, long remoteOffset, int length, object state = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sequenceNumber | Message sequence number. |
String | fileName | The path of the local file. This cannot be a directory. |
Int64 | remoteOffset | The starting offset of the message data to download. |
Int32 | length | Number of bytes to transfer or -1 to transfer all data until an end of message is reached. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
By default, this method marks the message as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
GetMessageAsync(String, String, Int64, Int32, Object)
Begins asynchronous GetMessage operation. Downloads the message with the specified unique ID and writes its data into a local file.
Declaration
public Task<long> GetMessageAsync(string uniqueId, string fileName, long remoteOffset, int length, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueId | Message unique ID. |
String | fileName | The path of the local file. This cannot be a directory. |
Int64 | remoteOffset | The starting offset of the message data to download. |
Int32 | length | Number of bytes to transfer or -1 to transfer all data until an end of message is reached. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
By default, this method marks the message as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
GetMessageAsync(Int32, String, Object)
Begins asynchronous GetMessage operation. Downloads the message with the specified sequence number and writes its data into a local file.
Declaration
public Task<long> GetMessageAsync(int sequenceNumber, string fileName, object state = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sequenceNumber | Message sequence number. |
String | fileName | The path of the local file. This cannot be a directory. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
By default, this method marks the message as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
GetMessageAsync(String, String, Object)
Begins asynchronous GetMessage operation. Downloads the message with the specified unique ID and writes its data into a local file.
Declaration
public Task<long> GetMessageAsync(string uniqueId, string fileName, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueId | Message unique ID. |
String | fileName | The path of the local file. This cannot be a directory. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | The length of the message in bytes. |
Remarks
Uses IMAP FETCH command to retrieve the message.
By default, this method marks the message as read. To prevent this behavior, set the UsePeekForGetMessage to true
.