Retrieves the set of mail messages with the specified unique identifiers (UIDs) while only fetching those parts of the messages that satisfy the condition of the specified delegate.

Namespace: S22.Imap
Assembly: S22.Imap (in S22.Imap.dll) Version: 3.6.0.0 (3.6.0.0)

Syntax

C#
public IEnumerable<MailMessage> GetMessages(
	IEnumerable<uint> uids,
	ExaminePartDelegate callback,
	bool seen = true,
	string mailbox = null
)

Parameters

uids
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'UInt32>)>)>
An enumerable collection of unique identifiers of the mail messages to retrieve.
callback
Type: S22.Imap..::..ExaminePartDelegate
A delegate which will be invoked for every MIME body-part of each mail message to determine whether the part should be fetched from the server or skipped.
seen (Optional)
Type: System..::..Boolean
Set this to true to set the \Seen flag for the fetched messages on the server.
mailbox (Optional)
Type: System..::..String
The mailbox the messages will be retrieved from. If this parameter is omitted, the value of the DefaultMailbox property is used to determine the mailbox to operate on.

Return Value

An enumerable collection of initialized instances of the MailMessage class representing the fetched mail messages.

Implements

IImapClient..::..GetMessages(IEnumerable<(Of <<'(UInt32>)>>), ExaminePartDelegate, Boolean, String)

Remarks

A unique identifier (UID) is a 32-bit value assigned to each message which uniquely identifies the message within the respective mailbox. No two messages in a mailbox share the same UID.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThe uids parameter or the callback parameter is null.
S22.Imap..::..BadServerResponseExceptionThe mail messages could not be fetched. The message property of the exception contains the error message returned by the server.
System..::..ObjectDisposedExceptionThe ImapClient object has been disposed.
System.IO..::..IOExceptionThere was a failure writing to or reading from the network.
S22.Imap..::..NotAuthenticatedExceptionThe method was called in non-authenticated state, i.e. before logging in.

See Also