You are here

function swiftmailer_remove_header in Swift Mailer 7

Removes a header from a message.

Parameters

Swift_Message $message: The message which the header is to be removed from.

string $key: The header key.

7 calls to swiftmailer_remove_header()
swiftmailer_add_date_header in includes/helpers/conversion.inc
Adds a date header to a message.
swiftmailer_add_id_header in includes/helpers/conversion.inc
Adds an id header to a message.
swiftmailer_add_mailbox_header in includes/helpers/conversion.inc
Adds a mailbox header to a message.
swiftmailer_add_parameterized_header in includes/helpers/conversion.inc
Adds a parameterized header to a message.
swiftmailer_add_path_header in includes/helpers/conversion.inc
Adds a path header to a message.

... See full list

File

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

Code

function swiftmailer_remove_header(Swift_Message $message, $key) {

  // Get message headers.
  $headers = $message
    ->getHeaders();

  // Remove the header if it already exists.
  $headers
    ->removeAll($key);
}