Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > RetrieveStructure Method > RetrieveStructure Method (Integer, TIdMessage)
TIdIMAP4.RetrieveStructure Method (Integer, TIdMessage)
function RetrieveStructure(
    const AMsgNum: Integer; 
    AMsg: TIdMessage
): Boolean; overload;
Message number.
Message instance used to store informatiuon about message parts for the message. 

Boolean - True on success.

RetrieveStructure is an overloaded Boolean function used to return a list of the message parts for the message specified in AMsgNum. 

AMsg is used to return the list of message parts with additional information about the size and content transfer encoding applied to the individual message parts. 

RetrieveStructure validates the message number in AMsgNum to ensure that it contains a positive non-zero value, and raises an EIdNumberInvalid exception if the requirement is not met. 

RetrieveStructure requires that ConnectionState contain the value csSelected, or an EIdConnectionStateError exception will be raised. Use SelectMailBox or ExamineMailBox to select a mailbox prior to calling RetrieveStructure. 

RetrieveStructure sends the IMAP4 FETCH command using the specified message number and arguments needed to retrieve the Body structure for the message stored in the current mailbox on the remote IMAP4 server. 

The return value for the method is True if retrieval of the message part list is completed successfully. The return value for the method is False if a protocol error response (any value other than IMAP_OK) is received during processing in the method. 

RetrieveStructure parses text in the IMAP4 server response, and stores the data about the message parts in the parameter provided to the method. 

RetrieveStructure is used in the implementation of other TIdIMAP4 methods, like RetrieveText and UIDRetrieveText. RetrieveStructure may also be used to access the structure for the message prior to calling methods that require relative message part numbers and content transfer encoding information, like RetrievePart and UIDRetrievePart.

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