MAIL -> boolean addheader ( string name, string value [, string charset [, string encoding ]] )
Return TRUE if has been successfully added, FALSE if not.
Default values are:
string charset: utf-8
string encoding: quoted-printable
string encoding possible values are: quoted-printable or base64
The most important values of header (see the list) can not be set.
This values are automatically build or you can use a function to set it.
List of headers name that can NOT be set using this function:
Subject, From, To, Cc, Bcc, Date, Content-Type,
Content-Transfer-Encoding, Content-Disposition, Message-ID,
X-Mailer, X-Priority, X-MSMail-Priority, X-MimeOLE, MIME-Version
Notice: you can add multiple header values with the same name.
Example (verification):
$m = new MAIL;
// add "X-Whatever" mail header value
$h = $m->AddHeader('X-Whatever', 'the value');
echo $h ? 'added' : 'error';
|
Example (deprecated):
$m = new MAIL;
// add "X-Whatever" mail header value, charset and encoding
$m->Header[] = array(
'name' => 'X-Whatever', // required
'value' => 'the value', // required
'charset' => 'utf-8', // optional
'encoding' => 'base64' // optional
);
// add another "X-Whatever" mail header value
$m->Header[] = array('name' => 'X-Whatever', 'value' => 'the second value');
|
See Also: MAIL->DelHeader()
[ Comments ]
Last update: Tuesday, October 23, 2007