Change “From” name of email in WordPress when it sends notifications to users
This snip of code lets you customize the email “from” that appear on emails sent from WordPress. By default the “From Name” on emails sent from wordpress has a name “WordPress”. To change from name with your blog name, simply copy and paste the code into the function.php file of your theme.
// change mail from name function reset_fromname($email){ $wpfrom = get_option('blogname'); return $wpfrom; } add_filter('wp_mail_from_name', 'reset_fromname');
You can also change From email address. To do this, insert code below into functions.php
// change from email address function reset_fromemail($email){ $wpfromemail = 'example@yourdomain.com'; return $wpfromemail; } add_filter('wp_mail_from', 'reset_fromemail');