I use these two functions to filter the from email address, and the from name for emails sent from the site.

<?php
function site_mail_from(){
$admin_email = get_option('admin_email');
return $admin_email;
};
add_filter('wp_mail_from', 'site_mail_from');
function site_mail_from_name(){
$site_name = get_bloginfo( 'name' );
return $site_name;
};
add_filter('wp_mail_from_name ', 'site_mail_from_name ');
view raw email_filters.php hosted with ❤ by GitHub
Tagged: