Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#25354 closed defect (bug) (duplicate)

@from address in mails works only in Windows

Reported by: ymajoros's profile ymajoros Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:

Description

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 ) )

Change History (1)

#1 @SergeyBiryukov
12 years ago

  • Component changed from General to Mail
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #18792.

Note: See TracTickets for help on using tickets.