[wp-trac] [WordPress Trac] #56779: wp_mail header ignores multiple headers with same name
WordPress Trac
noreply at wordpress.org
Mon Oct 10 10:07:49 UTC 2022
#56779: wp_mail header ignores multiple headers with same name
----------------------------+-----------------------------
Reporter: pentatonicfunk | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version:
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
Context:
https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-
includes/pluggable.php#L344
Snippet `wp_mail`
{{{#!php
default:
// Add it to our grand headers array.
$headers[ trim( $name ) ] = trim( $content );
break;
}}}
Passing headers this way:
{{{#!php
$headers[] = 'x-my-things: thing1';
$headers[] = 'x-my-things: thing2';
}}}
Will resulting headers only generated one ( the last one )
{{{#!php
$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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56779>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list