Thursday, August 2, 2012

Change WordPress “from” email header

By default, the default WordPress email adress looks like WordPress@yoursitename.com. Want to use your real email and username instead?

function res_fromemail($email) {
$wpfrom = get_option('admin_email');
return $wpfrom;
}
function res_fromname($email){
$wpfrom = get_option('blogname');
return $wpfrom;
}
add_filter('wp_mail_from', 'res_fromemail');
add_filter('wp_mail_from_name', 'res_fromname');

No comments:

Post a Comment