Imap.GetMessage Method
Namespace: Rebex.Net
Assembly: Rebex.Imap.dll (version 7.0.9313)
GetMessage(Int32, Stream, Int64, Int32)
Downloads the specified part of the message with the specified sequence number and writes its data into a supplied stream.
Declaration
public long GetMessage(int sequenceNumber, Stream output, long remoteOffset, int length)
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.  | 
    
Returns
| Type | Description | 
|---|---|
| Int64 | The length of the message in bytes.  | 
    
Remarks
Uses IMAP FETCH command to retrieve the message.
GetMessage(String, Stream, Int64, Int32)
Downloads the specified part of the message with the specified unique ID and writes its data into a supplied stream.
Declaration
public long GetMessage(string uniqueId, Stream output, long remoteOffset, int length)
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.  | 
    
Returns
| Type | Description | 
|---|---|
| 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.
GetMessage(Int32, Stream)
Downloads the message with the specified sequence number and writes its data into a supplied stream.
Declaration
public long GetMessage(int sequenceNumber, Stream output)
Parameters
| Type | Name | Description | 
|---|---|---|
| Int32 | sequenceNumber | Message sequence number.  | 
    
| Stream | output | Stream that will receive the message.  | 
    
Returns
| Type | Description | 
|---|---|
| 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.
GetMessage(String, Stream)
Downloads the message with the specified unique ID and writes its data into a supplied stream.
Declaration
public long GetMessage(string uniqueId, Stream output)
Parameters
| Type | Name | Description | 
|---|---|---|
| String | uniqueId | Message unique ID.  | 
    
| Stream | output | Stream that will receive the message.  | 
    
Returns
| Type | Description | 
|---|---|
| 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.
GetMessage(Int32, String, Int64, Int32)
Downloads the message with the specified sequence number and writes its data into a local file.
Declaration
public long GetMessage(int sequenceNumber, string fileName, long remoteOffset, int length)
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.  | 
    
Returns
| Type | Description | 
|---|---|
| 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.
GetMessage(String, String, Int64, Int32)
Downloads the message with the specified unique ID and writes its data into a local file.
Declaration
public long GetMessage(string uniqueId, string fileName, long remoteOffset, int length)
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.  | 
    
Returns
| Type | Description | 
|---|---|
| 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.
GetMessage(Int32, String)
Downloads the message with the specified sequence number and writes its data into a local file.
Declaration
public long GetMessage(int sequenceNumber, string fileName)
Parameters
| Type | Name | Description | 
|---|---|---|
| Int32 | sequenceNumber | Message sequence number.  | 
    
| String | fileName | The path of the local file. This cannot be a directory.  | 
    
Returns
| Type | Description | 
|---|---|
| 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.
GetMessage(String, String)
Downloads the message with the specified unique ID and writes its data into a local file.
Declaration
public long GetMessage(string uniqueId, string fileName)
Parameters
| Type | Name | Description | 
|---|---|---|
| String | uniqueId | Message unique ID.  | 
    
| String | fileName | The path of the local file. This cannot be a directory.  | 
    
Returns
| Type | Description | 
|---|---|
| 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.