Make WordPress Core

Opened 2 years ago

#56779 new enhancement

wp_mail header ignores multiple headers with same name

Reported by: pentatonicfunk's profile pentatonicfunk Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:

Description

Context:
https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/pluggable.php#L344
Snippet wp_mail

default:
    // Add it to our grand headers array.
    $headers[ trim( $name ) ] = trim( $content );
    break;

Passing headers this way:

$headers[] = 'x-my-things: thing1';
$headers[] = 'x-my-things: thing2';

Will resulting headers only generated one ( the last one )

$headers['x-my-things'] = 'thing2';

Expectation, it should retain the headers index, should behave similarly with phpmaailer::addCustomHeader, headers indexed by numeric, and each item contains name and value.

Example use case Mailgun x-mailgun-tag, https://documentation.mailgun.com/en/latest/user_manual.html?highlight=x-mailgun-tag

Change History (0)

Note: See TracTickets for help on using tickets.