Archive Old post. Originally published 7 December 2011 on the WordPress version of this site. Preserved here for the search engines and the curious. Old me had opinions.
Developer 2 min read

WordPress Email from Address

Just a quick from me today.

WordPress is pretty good, but one thing that always was a little strange was the way your site emails always came from “wordpress@mydomain.com” instead of being able to set it yourself.

Open up your themes functions.php bang this in, edit as per your needs and you’re done!

add_filter('wp_mail_from', 'custom_mail_from');
add_filter('wp_mail_from_name', 'custom_mail_from_name');

function custom_mail_from($old) {
 return 'howdy@myawesomedomain.com';
}
function custom_mail_from_name($old) {
 return 'I own you WP';
}

Filed under Developer. No comments, on purpose.