Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.RetrieveHeader
Retrieves headers for a specified message number and populates the message instance.

function RetrieveHeader(const AMsgNum: Integer; AMsg: TIdMessage): Boolean;
Parameters
const AMsgNum: Integer
Message number to be retrieved from the mailbox.

AMsg: TIdMessage
Message instance used to store retrieved header values.

Returns
Boolean - True on success.

Description
RetrieveHeader is a Boolean function that retrieves headers for the message number specified in AMsgNum, and populates the message instance AMsg with the header values.

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

RetrieveHeader send the IMAP4 FETCH command for the specified message number to access the stored header values. RetrieveHeader insures that the untagged server response contains an RFC 822 header before calling ReceiveHeader to populate the header values in the message instance.

RetrieveHeader sets the return value to True when ResultNo contains the value wsOk.