Topic Path: Symbol Reference > Classes > TIdMessage Class > TIdMessage Methods > AddHeader Method
ContentsIndexHome
PreviousUpNext
TIdMessage.AddHeader Method

Adds a header and value to the message.

procedure AddHeader(
    const AValue: string
);
Parameters 
Description 
Value 
header name and value in "NAME: VALUE" form. 

AddHeader is a procedure used to add a header name and value to the Headers for the message. Value is the RFC 2822 message header to be added in the "NAME: VALUE" form. AddHeader is a convenience method that calls the Add method in Headers using the contents of Value. 

AddHeader can be used to add standard or experimental headers after the message has loaded the header values in TIdMessageClient, and set property values using ProcessHeaders. For headers that have corresponding properties in TIdMessage, use the property to read or write the value for the header. 

Use ExtraHeaders for custom message headers that need to be kept in a separate or distinct container until the message is transmitted or stored. 

AddHeader does not perform line folding for long header values. Use methods and properties in Header to ensure that header folding is respected when using long header values.

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