Topic Path: Symbol Reference > Classes > TIdPOP3 Class > TIdPOP3 Methods > RetrieveHeader Method
TIdPOP3.RetrieveHeader Method

Retrieves headers for a message.

function RetrieveHeader(
    const MsgNum: Integer; 
    AMsg: TIdMessage
): Boolean;
Message number to be retrieved.
Message instance where headers will be stored. 

Boolean - True on success.

RetrieveHeader is a Boolean function that retrieves the headers for the message number specified in MsgNum, and stores the header values in the TIdMessage instance specified in AMsg. 

RetrieveHeader uses SendCmd to send the POP3 TOP command for the specified message number. The POP3 TOP command is an optional POP3 feature, and may not be implemented on all POP3 servers. An EIdReplyPOP3Error will be raised if the POP3 server response does not contain the numeric values expected for the multi-line response. 

RetrieveHeader captures the multi-line response containing the message headers in the TIdMessage instance specified in AMsg. 

The return value for the method is set to True on successful completion of both the POP3 TOP command and capture of the message headers in AMsg.

(Delphi) Retrieving messsage headers from a POP3 mailbox. 


// IdPOP3: TIdPOP3;
// IdMessage: TIdMessage;

IdPOP3.RetrieveHeader(1, IdMessage);
on E: EIdReplyPOP3Error do ShowMessage(E.Message);
Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.