Downloads messages in the current folder that belong to a specified message set.

Namespace:  Rebex.Net
Assembly:  Rebex.Imap (in Rebex.Imap.dll)

Syntax

Visual Basic
Public Sub GetMessages ( _
	messageSet As ImapMessageSet, _
	messageReceiver As Action(Of ImapMessage) _
)
C#
public void GetMessages(
	ImapMessageSet messageSet,
	Action<ImapMessage> messageReceiver
)

Parameters

messageSet
Type: Rebex.Net..::..ImapMessageSet
A set of messages.
messageReceiver
Type: System..::..Action<(Of <(<'ImapMessage>)>)>
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.

Version Information

.NET Compact Framework

Supported in: 3.9, 3.5

See Also