Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > RetrieveAllHeaders Method
ContentsIndexHome
PreviousUpNext
TIdIMAP4.RetrieveAllHeaders Method

Retrieves headers for all messages in a mailbox and populates the specified message collection.

function RetrieveAllHeaders(
    AMsgList: TIdMessageCollection
): Boolean;
Parameters 
Description 
AMsgList 
Message collection to be populated. 

Boolean - True on success.

RetrieveAllHeaders is a Boolean function that retrieves headers for all messages in the currently selected mailbox, and populates the message collection specified in AMsgList with message instances to store the header values. 

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

When AMsgList is unassigned (Nil), RetrieveAllHeaders will set the return value to False and exit from the method. Otherwise, RetrieveAllHeaders will create a new TIdMessageItem in AMsgList and call RetrieveHeader for each individual relative message number stored in the Mailbox property. If the headers for a given message cannot be loaded from the IMAP4 mailbox, the return value is set to False and additional messages are ignored. 

RetrieveAllHeaders will return True when all message headers have been retrieved from the mailbox. 

RetrieveAllHeaders is used in SelectMailBox to automatically retrieve data from the selected mailbox when RetrieveOnSelect contains the value rsHeaders. 

RetrieveAllMsgs is used in SelectMailBox to fetch both message headers and message part contents in a message collection when RetrieveOnSelect contains the value rsMessages. 

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