[wp-trac] [WordPress Trac] #15448: wp_mail() sets Content-Type header twice for multipart emails
WordPress Trac
noreply at wordpress.org
Thu Nov 13 08:27:59 UTC 2025
#15448: wp_mail() sets Content-Type header twice for multipart emails
-------------------------------------------------+-------------------------
Reporter: rmccue | Owner: SirLouen
Type: defect (bug) | Status: closed
Priority: high | Milestone: 6.9
Component: Mail | Version: 2.8
Severity: normal | Resolution: fixed
Keywords: has-unit-tests has-test-info commit | Focuses:
needs-patch |
-------------------------------------------------+-------------------------
Changes (by rezwanshiblu1952):
* keywords: has-patch has-unit-tests has-test-info commit => has-unit-
tests has-test-info commit needs-patch
Comment:
Test Report:
This indicated the patch works as expected.
----
Patch tested:
https://github.com/WordPress/wordpress-develop/pull/9500.patch
----
Environment:
WordPress: 6.9-alpha-60093-src
PHP: 8.3
Server: apache
Database: mysqli
OS: MacOS
Theme: Twenty Twenty-Five
MU Plugins: None activated
Plugins:
Amazon S3 Email Testing 1.0.0
Manual Multipart/Alternative/Mixed Test 1.0.0
Test Reports 1.2.0
WP Mail SMTP 4.6.0
----
Actual Results:
1. Emails sent through wp_mail() with multipart formatting are now
properly interpreted.
2. Mailpit correctly separates and displays the plain text and HTML
sections in their respective tabs.
3. File attachments (e.g., attachment.pdf) are now detected and can be
accessed as expected.
4. MIME headers and boundaries are no longer exposed within the message
body.
----
Prior to applying the patch, Mailpit rendered the raw multipart message
structure, including inline MIME headers, and failed to recognize
attachments. After the patch, Mailpit correctly processes multipart
messages in line with PHPMailer’s expected behavior. No issues or
regressions were detected in the core wp_mail() functionality.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/15448#comment:101>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list