webCOMAND

mail::header()

Add or update an email header.  To set multiple headers with a single method, see mail::headers().

Prototype

void header(string $key, string $value = NULL)

Parameters

  • key - Header name, such as "Content-Type" or "X-Custom-Header".
  • value - Optional value to associate with the key.  For example, "text/html".

Example

$mail = new \io_comand_email\mail(
    'webmaster@webcomand.com',
    'Testing',
    "<p>This is a test.<br/>\nTesting 1, 2, 3.</p>"
);
$mail->header('Content-Type', 'text/html');
$mail->send();

Related