Internet Direct (Indy) Version 9.0.1 Beta
TIdIMAP4.RetrieveFlags
Retrieves message flags stored in a message on the IMAP4 server.

function RetrieveFlags(const AMsgNum: Integer; AFlags: TIdMessageFlagsSet): Boolean;
Parameters
const AMsgNum: Integer
Message number containing flags to be retrieved.

AFlags: TIdMessageFlagsSet
Pointer the array where messge flags are stored.

Returns
Boolean - True on success.

Description
RetrieveFlags is a Boolean function that is used to retrieves message flags for a the message number specified in stored in AMsgNum from an IMAP4 server.

RetrieveFlags requires that ConnectionState contain the value csSelected, or an EIdConnectionStateError exception will be raised.

RetrieveFlags calls the IMAP4 FETCH command to get flags for the specified message number. If a protocol error occurs while retrieving the flag value, RetrieveFlags sets the return value to False and exits from the method. On successful completion, RetrieveFlags processes the untagged responses in CmdResultDetails using ParseFlagString and sets the return value to True.