Internet Direct (Indy)
Home
PreviousUpNext
TIdMessage.SaveToFile Method

Stores message headers and contents in a file.

Pascal
procedure SaveToFile(
    const AFileName: string; 
    const AHeadersOnly: Boolean = False
);
Parameters 
Description 
AFileName 
File to use for storing the message.
 
AHeadersOnly 
Message should store only headers to the file. 

SaveToFile is a procedure used to store the headers and/or message parts for the message in the file specified in AFilename. If the file specified in AFileName already exists, the file is deleted prior to creating the output for the current message. 

AHeadersOnly indicates if only message headers should be written for the message instance. When AHeadersOnly is False, the entire message including all Headers and MessageParts will be stored in the output file. 

SaveToFile calls SaveToStream using an internal file stream to perform the physical output operation. The file stream instance is freed prior to exiting from the method. 

Use LoadFromFile to retrieve the contents of a specified file created using SaveToFile in the current message instance.

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.