Retrieves SMTP envelope information for a message in the mailbox.
function RetrieveEnvelope( const AMsgNum: Integer; AMsg: TIdMessage ): Boolean;
Boolean - True on success.
RetrieveEnvelope is a Boolean function used to retrieve the SMTP envelope information for the relative message number specified in AMsgNum, and to store the information in the message identified by AMsg.
RetrieveEnvelope validates the relative message number in aMsg to ensure that it contains a positive non-zero value. An EIdNumberInvalid exception will be raised when the realtive message number is invalid.
RetrieveEnvelope requires that ConnectionState contain the value csSelected, indicating a mailbox has been successfully selected and authenticated. RetrieveEnvelope can raise an EIdConnectionStateError exception if a mailbox has not been selected and/or authenticated for the current user.
RetrieveEnvelope calls SendCmd using the IMAP4 FETCH command and arguments constructed from the value in AMsgNum and the IMAP4 fetch data flags required for the operation. RetrieveEnvelope reads the multi-line response from the IMAP4 server, and verifies that the initial response matches the command issued using SendCmd. When they are the same, RetrieveEnvelope extracts the SMTP headers from the response and parses the header values in the message specified in AMsg.
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.