Topic Path: Symbol Reference > Classes > TIdMessage Class > TIdMessage Methods > SaveToFile Method
TIdMessage.SaveToFile Method

Stores message headers and contents in a file.

procedure SaveToFile(
    const AFileName: string; 
    const AHeadersOnly: Boolean = False
File to use for storing the message.
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.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.