[wp-trac] [WordPress Trac] #53393: Latest version of PHPMailer no longer attaches files to emails

WordPress Trac noreply at wordpress.org
Mon Jun 14 01:18:07 UTC 2021


#53393: Latest version of PHPMailer no longer attaches files to emails
--------------------------+-----------------------------
 Reporter:  threeatetwo   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.7.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I've been trying to track down why my s3 bucket files are no longer being
 attached to automated emails being sent out by WordPress (using the
 Gravity Forms Entry Automation plugin).

 I've been able to identify the latest version of PHPMailer being the
 reason why the attachments no longer get added. From the author:

 ----
 ''This is due to a bug fix that also closed a major security hole.
 PHPMailer deliberately avoids being a client for HTTP or other protocols
 for file attachments because it is far too risky. The solution is to take
 on responsibility for fetching remote files yourself. Instead of :''

 {{{
 $mail->addAttachment('s3://file.txt', 'file.txt');
 }}}

 ''Do this:''

 {{{
 $mail->addStringAttachment(file_get_contents('s3://file.txt'),
 'file.txt');
 }}}

 https://github.com/PHPMailer/PHPMailer/issues/2355#issuecomment-858373284

 ----

 I reached out to the Gravity Forms authors as well as the Entry Automation
 authors and they both have said their plugins just generate raw
 notification objects and then use wp_mail() to pass the generated mail
 object off to the rest of my server to actually handle the sending.

 Is there a way to get this working again without having to roll my WP
 version back? Or do y'all know how others are handling this issue?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53393>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list