Internet Direct (Indy) Version 9.0.1 Beta
TIdIMAP4.ExamineMailBox
Select a mailbox for read-only access.

function ExamineMailBox(const AMBName: String; AMB: TIdMailBox): Boolean; overload;
Parameters
const AMBName: String
Mailbox name to use accessed on the IMAP4 server.

AMB: TIdMailBox
Mailbox to be filled with the retrieved message values.

Returns
Boolean - True on success.

Description
ExamineMailBox is a Boolean function in TIdIMAP4 used to select the mailbox specified in AMBName for read-only access. Messages and Flags are retrieved from the mailbox and stored in the TIdMalBox instance specified in AMB.

ExamineMailBox returns the same output as SelectMailBox, except for the read-only attribute applied to the mailbox, flags, and messages.

ExamineMailBox requires that the value of ConnectionState contain either csAuthenticated or csSelected, or an EIdConnectionStateError exception will be raised.

ExamineMailBox calls SendCmd using the IMAP EXAMINE command. When ResultNo contains wsOk, the ParseSelectResultDetails method is called to populate the TIdMailBox instance specified by AMB.