You are here

public static function Conversion::swiftmailer_remove_header in Swift Mailer 8.2

Same name and namespace in other branches
  1. 8 src/Utility/Conversion.php \Drupal\swiftmailer\Utility\Conversion::swiftmailer_remove_header()

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.

6 calls to Conversion::swiftmailer_remove_header()
Conversion::swiftmailer_add_date_header in src/Utility/Conversion.php
Adds a date header to a message.
Conversion::swiftmailer_add_id_header in src/Utility/Conversion.php
Adds an id header to a message.
Conversion::swiftmailer_add_mailbox_header in src/Utility/Conversion.php
Adds a mailbox header to a message.
Conversion::swiftmailer_add_parameterized_header in src/Utility/Conversion.php
Adds a parameterized header to a message.
Conversion::swiftmailer_add_path_header in src/Utility/Conversion.php
Adds a path header to a message.

... See full list

File

src/Utility/Conversion.php, line 347

Class

Conversion
@todo

Namespace

Drupal\swiftmailer\Utility

Code

public static function swiftmailer_remove_header(Swift_Message $message, $key) {

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

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