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

Retrieves the body structure for a specified message.

function InternalRetrieveStructure(
    const AMsgNum: Integer; 
    AMsg: TIdMessage; 
    AParts: TIdImapMessageParts
): Boolean;
Relative message number for the requested message.
Message instance to store FETCH results from the server.
Message parts that represent the body structure for the message. 

Boolean - True on success.

InternalRetrieveStructure is a Boolean function used to implement retrieving the body structure for the relative message number specified in AMsgNum. InternalRetrieveStructure is used in the implementation of the RetrieveStructure method. 

AMsg is the TIdMessage instance to use for retrieving the contents of the specified message. 

AParts is a TIdImapMessageParts instance used to store the message parts that represent the BODYSTRUCTURE response from the IMAP4 server. 

InternalRetrieveStructure requires ConnectionState to contain the value csSelected, indicating a mailbox has been previously selected using SelectMailBox, or an EIdConnectionStateError exception is raised. 

InternalRetrieveStructure uses SendCmd to send the IMAP4 FETCH command with the specified message number and the BODYSTRUCTURE argument. When a successful FETCH response is received, values in LastCmdResult are parsed to store message parts that represent the body structure in AParts. 

The return value for the method is True if the body structure for the specified message number is successfully retrieved using the method.

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