[wp-trac] [WordPress Trac] #28407: You are unable to override the attachment name in wp_mail() when adding attachments

WordPress Trac noreply at wordpress.org
Tue Jul 8 13:37:23 UTC 2014


#28407: You are unable to override the attachment name in wp_mail() when adding
attachments
-------------------------+------------------------------
 Reporter:  syntaxart    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Mail         |     Version:  3.9.1
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by p_j_albuquerque):

 Replying to [comment:4 SergeyBiryukov]:
 > #28782 was marked as a duplicate.

 It is possible to send multiple file attachment.
 It would be possible to change.

 if ( !empty( $attachments ) ) {
                 foreach ( $attachments as $attachment ) {
                         try {
                                 if(is_array($attachment)){
                                         list($name, $file) =
 each($attachment);
                                         $phpmailer->AddAttachment($file,
 $name);
                                 }else{
 $phpmailer->AddAttachment($attachment);
                                 }
                         } catch ( phpmailerException $e ) {
                                 continue;
                         }
                 }
         }

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


More information about the wp-trac mailing list