Imap.GetMessages Method
Namespace: Rebex.Net
Assembly: Rebex.Imap.dll (version 7.0.9083)
GetMessages(ImapMessageSet, Action<ImapMessage>)
Downloads messages in the current folder that belong to a specified message set.
Declaration
public void GetMessages(ImapMessageSet messageSet, Action<ImapMessage> messageReceiver)
Parameters
Type | Name | Description |
---|---|---|
ImapMessageSet | messageSet | A set of messages. |
Action<ImapMessage> | messageReceiver | A handler to process received messages. It has to process messages (and exit) quickly. If slow/complex processing is required, hand messages over to other thread. |
Remarks
Uses IMAP FETCH command to retrieve messages.
By default, this method marks messages as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
This method demands a lot of data to be received from the server.
The data has to be read from the network socket as fast as possible.
This places demand on messageReceiver
handler to process received messages as fast as possible.
If the handler slows the process too much, incoming data will not be read from the underlying network socket in sufficient speed
and TCP internal buffers will be overfilled. This can cause strange network exceptions.
GetMessages(ImapMessageSet, ImapListFields, Action<ImapMessage>)
Downloads messages in the current folder that belong to a specified message set.
Declaration
public void GetMessages(ImapMessageSet messageSet, ImapListFields fields, Action<ImapMessage> messageReceiver)
Parameters
Type | Name | Description |
---|---|---|
ImapMessageSet | messageSet | A set of messages. |
ImapListFields | fields | Specifies the scope of information to determine about each message. |
Action<ImapMessage> | messageReceiver | A handler to process received messages. It has to process messages (and exit) quickly. If slow/complex processing is required, hand messages over to other thread. |
Remarks
Uses IMAP FETCH command to retrieve messages.
By default, this method marks messages as read. To prevent this behavior, set the UsePeekForGetMessage to true
.
This method demands a lot of data to be received from the server.
The data has to be read from the network socket as fast as possible.
This places demand on messageReceiver
handler to process received messages as fast as possible.
If the handler slows the process too much, incoming data will not be read from the underlying network socket in sufficient speed
and TCP internal buffers will be overfilled. This can cause strange network exceptions.