WordPress Snippets at WPcustoms

Change WordPress FROM email name and address

You cannot change the default FROM email address and name in your admin panel. Use this function to customize that info. Cool thing to have for sites with open registrations.


/**
 * Snippet Name: Change WordPress FROM email name and address
 * Snippet URL: http://www.wpcustoms.net/snippets/change-from-email-name/
 */
 function wpc_new_mail_from($old) {
 return 'admin@yoursite.com'; // change this to a valid address or use noreply@yoursite.com
}
function wpc_new_mail_from_name($old) {
 return 'Your Blog Name'; // put any name in here
}
add_filter('wp_mail_from', 'wpc_new_mail_from');
add_filter('wp_mail_from_name', 'wpc_new_mail_from_name');