[wp-trac] [WordPress Trac] #52822: PHPMailer change in WordPress 5.7 breaks working sites

WordPress Trac noreply at wordpress.org
Thu Mar 25 13:12:09 UTC 2021


#52822: PHPMailer change in WordPress 5.7 breaks working sites
-------------------------------------+---------------------
 Reporter:  tigertech                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  high                     |   Milestone:  5.7.1
Component:  Mail                     |     Version:  5.7
 Severity:  normal                   |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:
-------------------------------------+---------------------

Comment (by SergeyBiryukov):

 Replying to [comment:4 audrasjb]:
 > I’m not a specialist of PHPMailer, but for 5.7.1, I can see several
 options:
 > - Find a way to override PHPMailer settings
 > - Directly edit the PHPMailer lib (this is not something we want)
 > - Rollback PHPMailer to its previous version (same as above!)
 >
 > For more context, after a quick search, I think the issue comes from
 this upstream function:
 https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php#L1263
 >
 > (the new default value of the third parameter – `$auto = true` – I can’t
 tell why but it looks like the issue is related to this change)

 Thanks! Just noting that the parameter is not new in PHPMailer 6.3.0, it
 was added 11 years ago in version 5.1, see the
 [https://github.com/PHPMailer/PHPMailer/commit/5b661107cab6ae3d96a076532c8fccf23ea07ece
 #diff-2d294eae28fb0d70fc32da8369c4fe33d301c99ca3eeb4bd41da18ad99344d68R482
 upstream commit] and [17676] for core. The `wp_mail()` function in
 WordPress [source:tags/5.7/src/wp-includes/pluggable.php?marks=397#L387
 explicitly passes `false`] there.

 I think the issue comes from this commit:
 https://github.com/PHPMailer/PHPMailer/commit/f9f5b8d21ed2b79fe2e660f2c0ae9c676e30210c

 It should be possible to override the default settings using the
 `phpmailer_init` action, as suggested in comment:2, so I think the first
 option would be the preferred way here. It's also worth checking if any
 issues have been submitted upstream for this change.

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


More information about the wp-trac mailing list