[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
Tue Sep 9 16:41:14 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 |
-------------------------------------------------+-------------------------
Comment (by sajjad67):
= Success Test Report =
After applying the latest patch from [PR
#9417](https://github.com/WordPress/wordpress-develop/pull/9417) it now
works perfectly. Sending any length of body text goes into inbox.
== Environment ==
* **WordPress:** 6.9-alpha-60093-src
* **PHP:** 8.2.29
* **Server:** nginx/1.29.1
* **Database:** MySQL 8.4.6 (mysqlnd 8.2.29)
* **Browser:** Chrome 139.0.0.0
* **OS:** Windows 10/11
* **Theme:** Twenty Twenty-Five 1.3
* **Plugins Active:**
* Email Testing 1.0.0 (custom test plugin)
* Test Reports 1.2.0
== ✅ Expected Result ==
* All test emails should be sent successfully, regardless of body length.
== ✅ Actual Result ==
* Emails with **any body length** works now.
{{{
Return-Path: <from at example.com>
Received: from localhost (wordpress-develop-php-1.wordpress-
develop_wpdevnet. [172.18.0.3])
by eb84c58a3dd4 (Mailpit) with SMTP
for <test at example.com>; Tue, 9 Sep 2025 16:30:57 +0000 (UTC)
Date: Tue, 9 Sep 2025 16:30:57 +0000
To: test at example.com
From: WordPress <from at example.com>
Subject: Test Subject
Message-ID: <ZBdIPJ9HDcyMmsqahX8mHRUc8iLmI7xrEAJwkvWLh8 at localhost>
X-Mailer: PHPMailer 6.10.0 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
A
}}}
{{{
Return-Path: <from at example.com>
Received: from localhost (wordpress-develop-php-1.wordpress-
develop_wpdevnet. [172.18.0.3])
by eb84c58a3dd4 (Mailpit) with SMTP
for <test at example.com>; Tue, 9 Sep 2025 16:31:48 +0000 (UTC)
Date: Tue, 9 Sep 2025 16:31:48 +0000
To: test at example.com
From: WordPress <from at example.com>
Subject: Test Subject
Message-ID: <aSKIP0ZJHQ9cGxaGd3XqWlCJ5iWBNl0LiaY84jekTo at localhost>
X-Mailer: PHPMailer 6.10.0 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
}}}
📸 **Screenshot:**
[[Image(https://img001.prntscr.com/file/img001/lhbTPQolQSqWnFiADL22Xg.png)]]
[[Image(https://img001.prntscr.com/file/img001/tg0sP5aZSB6BGmXnOjfoig.png)]]
== Steps to Reproduce ==
1. Install and activate the provided **Email Testing** plugin.
2. Navigate to **Tools → Mail Test** in wp-admin.
3. Click **Send Test Email**.
4. Observe results:
* Messages with any body length succeed.
== Notes ==
* Issue resolved after applying [PR #9417](https://github.com/WordPress
/wordpress-develop/pull/9417).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33972#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list