[wp-trac] [WordPress Trac] #15448: wp_mail() sets Content-Type header twice for multipart emails
WordPress Trac
noreply at wordpress.org
Thu Jun 26 16:34:48 UTC 2025
#15448: wp_mail() sets Content-Type header twice for multipart emails
-------------------------------------------------+-------------------------
Reporter: rmccue | Owner:
| SergeyBiryukov
Type: feature request | Status: reviewing
Priority: normal | Milestone: Future
| Release
Component: Mail | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests has-test- | Focuses:
info reported-upstream |
-------------------------------------------------+-------------------------
Comment (by SirLouen):
== Patch Testing Instructions
1. First follow [https://core.trac.wordpress.org/ticket/15448#comment:69
the regular bug reproduction instructions]
2. After you have everything setup, and failing to create a multipart
email with the regular string version, its time to add the patch
3. Create an array version. The array version must provides the following:
- Instead of providing the `$message` as a single string it must provide
the $message as an key-value array.
- The keys should be the Content-Type parts of the multipart. For example,
`text/plain` and `text/html`. You could also try to add an attachment if
you want to do a great test
- The value should be the content for each of the parts.
4. The rest can be the same as the original example
If everything went right and patch is working as expected, you should see
an HTML/Text multipart/alternative Email, or with attachments a
multipart/mixed
--
Ticket URL: <https://core.trac.wordpress.org/ticket/15448#comment:73>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list