The wp_mail_from_name
filter modifies the "from name" used in an email sent using the wp_mail function. When used together with the 'wp_mail_from' filter, it creates a from address like "Name <email@address.com>". The filter should return a string.
add_filter( 'wp_mail_from_name', 'custom_wp_mail_from_name' );
function custom_wp_mail_from_name( $original_email_from ) {
return 'WordPress Email System';
}
It is not necessary to call another method if you can use anonymous functions (PHP 5.3.0+):
add_filter( 'wp_mail_from_name', function( $name ) {
return 'WordPress Email System';
});
remove_filter()
.Since: Version 2.3
wp_mail_from
is located in wp-includes/pluggable.php