You are here

function swiftmailer_add_text_header in Swift Mailer 7

Adds a text header to a message.

Parameters

Swift_Message $message: The message which the text header is to be added to.

string $key: The header key.

string $value: The header value.

1 call to swiftmailer_add_text_header()
SWIFTMailSystem::mail in includes/classes/SWIFTMailSystem.inc
Sends a message composed by drupal_mail().

File

includes/helpers/conversion.inc, line 58
This file contains conversion functions.

Code

function swiftmailer_add_text_header(Swift_Message $message, $key, $value) {

  // Remove any already existing header identified by the provided key.
  swiftmailer_remove_header($message, $key);

  // Add the header.
  $message
    ->getHeaders()
    ->addTextHeader($key, $value);
}