[wp-trac] [WordPress Trac] #33972: static use of PHPMailer class results in stale state between calls to wp_mail()
WordPress Trac
noreply at wordpress.org
Sat Sep 13 22:04:50 UTC 2025
#33972: static use of PHPMailer class results in stale state between calls to
wp_mail()
-------------------------------------------------+-------------------------
Reporter: codebuddy | Owner: rishabhwp
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Mail | Version: 4.3
Severity: critical | Resolution:
Keywords: has-test-info good-first-bug has- | Focuses:
patch needs-testing has-unit-tests has-dev- |
note |
-------------------------------------------------+-------------------------
Changes (by dilip2615):
* keywords: has-test-info good-first-bug has-patch needs-testing =>
has-test-info good-first-bug has-patch needs-testing has-unit-tests
has-dev-note
Comment:
== Test Report
=== Description
This report validates that the fix for #33972 works as expected on the
current trunk.
Patch tested: trunk @ becfe55789
=== Environment
- WordPress: 6.8.2
- PHP: 8.2.23
- Server: nginx/1.26.1
- Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.23)
- Browser: Chrome 140.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-One 2.5
- MU Plugins: None activated
- Plugins:
* Test Reports 1.2.0
=== Steps to Reproduce (Before)
1. On trunk, executed unit tests for wp_mail:
`npm run test:php -- tests/phpunit/tests/pluggable/wpMail.php`
2. Optional manual: Sent two consecutive `wp_mail()` calls (first forces
base64, second default) and inspected PHPMailer `Encoding` via
`phpmailer_init`.
=== Actual Results (After)
1. ✅ Unit tests: `OK (27 tests, 66 assertions)`
2. ✅ No Encoding bleed between consecutive `wp_mail()` calls;
headers/content behave as expected.
=== Additional Notes
- Could not reproduce the issue on the current trunk; behavior appears
correct.
- ✅ Tested on trunk @ becfe55789
Unit tests: OK (27 tests, 66 assertions)
Observation: Encoding bleed not reproducible on trunk.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33972#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list