You are here

function swiftmailer_add_mailbox_header in Swift Mailer 7

Adds a mailbox header to a message.

Parameters

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

string $key: The header key.

string $value: The header value.

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

File

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

Code

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

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

  // Parse mailboxes.
  $mailboxes = swiftmailer_parse_mailboxes($value);

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