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

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

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

Boolean - True on success.

RetrieveAllMsgs is a Boolean function used to retrieve all messages in the currently selected mailbox, and populates the message collection specified in AMsgList with message instances. 

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

RetrieveAllMsgs 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, RetrieveAllMsgs will create a new message in the collection and call Retrieve for each individual realtive message number found in the current MailBox for the IMAP4 account. 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. 

RetrieveAllMsgs will return True when all messages have been retrieved from the mailbox. 

Use RetrieveAllHeaders to fetch only message headers for the message collection.

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