[wp-trac] [WordPress Trac] #25354: @from address in mails works only in Windows

WordPress Trac noreply at wordpress.org
Thu Sep 19 09:42:57 UTC 2013


#25354: @from address in mails works only in Windows
--------------------------+-----------------------------
 Reporter:  ymajoros      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 As the summary says.

 Please use the setter, phpmailer::SetFrom

 phpmailer should have its properties private, but I guess I can't file a
 bug for that here.

 Here is the patch:


 {{{
 diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
 index 37ddb83..dd8f988 100644
 --- a/wp-includes/pluggable.php
 +++ b/wp-includes/pluggable.php
 @@ -337,8 +337,9 @@ function wp_mail( $to, $subject, $message, $headers =
 '', $attachments = array()
         }

         // Plugin authors can override the potentially troublesome default
 -       $phpmailer->From     = apply_filters( 'wp_mail_from'     ,
 $from_email );
 -       $phpmailer->FromName = apply_filters( 'wp_mail_from_name',
 $from_name  );
 +       $fromEmail = apply_filters( 'wp_mail_from', $from_email );
 +       $fromName = apply_filters( 'wp_mail_from_name', $from_name  );
 +       $phpmailer->SetFrom($fromEmail, $fromName);

         // Set destination addresses
         if ( !is_array( $to ) )
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25354>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list