Created
February 17, 2017 14:25
-
-
Save sander1/e38b7fa7686468646c8edc765232511f to your computer and use it in GitHub Desktop.
WordPress: Change Mail From and Return Path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wp_mail_from', function($email) { | |
return '[email protected]'; | |
}); | |
add_filter('wp_mail_from_name', function($name) { | |
return get_option('blogname'); | |
}); | |
class email_return_path { | |
function __construct() { | |
add_action('phpmailer_init', array($this, 'fix')); | |
} | |
function fix($phpmailer) { | |
$phpmailer->Sender = $phpmailer->From; | |
} | |
} | |
new email_return_path(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment