Internet Direct (Indy)
Home
PreviousUpNext
TIdMessageClient.ProcessMessage Method (TIdMessage, string, Boolean)

Receives and processes message headers and contents into a TIdMessage instance.

Pascal
procedure ProcessMessage(
    AMsg: TIdMessage; 
    const AFilename: string; 
    AHeaderOnly: Boolean = False
); overload;
Parameters 
Description 
AMsg 
Message to receive header and contents.
 
AFilename 
File name containing the contents of the headers and body for the message.
 
AHeaderOnly 
Retrieve message headers only. Default is False. 

ProcessMessage is an overloaded method in TIdMessageClient that implements receiving and processing of message headers and body contents from a file containing the Internet message. 

ProcessMessage ensures that the IOHandler for the message client is assigned and initialized for the operation. 

The file-based variant of ProcessMessage creates a TFileStream used to access message data in the file specified by AFilename, and calls the stream-based variant of ProcessMessage to load message data into AMsg. The TFileStream instance is freed prior to exiting from the method. 

AHeaderOnly indicates that the message client will retrieve only the headers for the message, and will not populate the contents of the message body. The default behavior (when AHeaderOnly is False) is to retrieve the entire message including both header and body contents. 

ProcessMessage does not make any assumptions about the contents of the TIdMessage instance in AMsg. In other words, ProcessMessage does not call TIdMessage.Clear before receiving header or body content. The application must call TIdMessage.Clear when reusing a TIdMessage instance for message retrieval.

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.