[wp-trac] [WordPress Trac] #62940: wp_mail(): Address header parsing is not RFC-5322 complient and fails on quoted-string when including a "<", ">" or ", "

WordPress Trac noreply at wordpress.org
Wed Sep 24 16:08:57 UTC 2025


#62940: wp_mail(): Address header parsing is not RFC-5322 complient and fails on
quoted-string when including a "<", ">" or ","
-------------------------------------------------+-------------------------
 Reporter:  bhujagendra                          |       Owner:  SirLouen
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Mail                                 |     Version:  2.1.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-test-info has-patch has-unit-    |     Focuses:
  tests reported-upstream                        |
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-test-info has-patch changes-requested has-unit-tests =>
     has-test-info has-patch has-unit-tests reported-upstream
 * owner:  jdeep => SirLouen
 * status:  assigned => reviewing


Comment:

 == TODO

 1. This address cannot be parsed by PHPMailer `From: "test<stage"
 <test at example.com>` It breaks with the first angle bracket.
 [https://github.com/PHPMailer/PHPMailer/issues/3235 Reported Upstream]

 2. Reply-To is unnecessarily inconsistent in PHPMailer. I will leave it
 away for now, while preserving the same format (as it's not relevant from
 the `wp_mail` wrapper). This only affects the test.
 [https://github.com/PHPMailer/PHPMailer/issues/3234 Reported Upstream]

 It's gonna be hard, because this is blocking two other reports. Problem
 with all this is that we are going so deep into the mail function, that a
 ton of problems are arising in an spiral ones blocking each other and then
 merging changes among all is a party :(

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62940#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list