Internet Direct (Indy)
Home
PreviousUpNext
TIdPOP3.RetrieveHeader Method

Retrieves headers for a message.

Pascal
function RetrieveHeader(
    const MsgNum: Integer; 
    AMsg: TIdMessage
): Boolean;
Parameters 
Description 
MsgNum 
Message number to be retrieved.
 
AMsg 
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;

try
IdPOP3.RetrieveHeader(1, IdMessage);
except
on E: EIdReplyPOP3Error do ShowMessage(E.Message);
end;
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.