Mail: Don't set Sender field when setting From.

[38058] changed `wp_mail()` so that it used PHPMailer's `setFrom()`
method rather than setting the From and FromName headers directly. See
behavior of setting the `Sender` field. This causes `mail` to be
called with the `-f` flag, which causes outgoing email to fail on some
server environments.

Props Clorith, iandunn, DrewAPicture.
Fixes #37736.

git-svn-id: https://develop.svn.wordpress.org/trunk@38286 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2016-08-20 02:16:54 +00:00
parent ba9eda1a9b
commit 54b51f1a26
2 changed files with 19 additions and 1 deletions

View File

@@ -349,7 +349,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
*/
$from_name = apply_filters( 'wp_mail_from_name', $from_name );
$phpmailer->setFrom( $from_email, $from_name );
$phpmailer->setFrom( $from_email, $from_name, false );
// Set destination addresses
if ( !is_array( $to ) )