Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > UIDRetrieveFlags Method
TIdIMAP4.UIDRetrieveFlags Method

Retrieves stored message flags for a message on the IMAP4 server.

function UIDRetrieveFlags(
    const AMsgUID: String; 
    var AFlags: TIdMessageFlagsSet
): Boolean;
Unique message identifier containing flags to be retrieved.
Storage for message flags in the specified message UID. 

Boolean - True on success.

UIDRetrieveFlags is a Boolean function used to retrieve stored message flags for the unique message identifier specified AMsgUID. Flags values retrieved from the current mailbox on the IMAP4 server are stored in the AFlags argument. 

UIDRetrieveFlags validates the unique message identifier in AMsgUID to ensuire that it contains a valid value, and raises an EIdNumberInvalid exception when AMsgUID contains an invalid value for use as a UID. 

UIDRetrieveFlags requires that ConnectionState contain the value csSelected, or an EIdConnectionStateError exception will be raised. Use SelectMailBox or ExamineMailBox to select the current mailbox for the IMAP4 account propr to calling UIDRetrieveFlags. 

UIDRetrieveFlags sends the IMAP4 FETCH command to get the flag values for the specified message UID. If a protocol response error occurs while retrieving the flag values, UIDRetrieveFlags sets the return value to False and exits from the method. AFlags will contains an empty set in this condition. 

On successful completion, UIDRetrieveFlags processes the untagged responses in IMAP4 server response, and sets the return value to True. 

Message flags returned in the AFlags argument can be stored in the TIdMessage.Flags property for items in MailBox

Use RetrieveFlags to retrieve message flags for a message using its relative message number. 

Use StoreFlags or UIDStoreFlags to update the stored message flags for a message in the mailbox on the remote IMAP4 server.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.