Manually Change Sender Name and Email Address

This technique is not recommended For beginners. You need to stick the code in your WordPress files with this process. It also does not solve any problems with email deliverability and is more difficult to troubleshoot. 
In the functions.php file of your theme or a site-specific plugin, you will have to add the subsequent code.

// Function to change email address
function pt_sender_email( $original_email_address ) {
    return 'prakashtyata@gmail.com';
}
 
// Function to change sender name
function pt_sender_name( $original_email_from ) {
    return 'Prakash Tyata';
}
 
// Hooking up our functions to WordPress filters 
add_filter( 'wp_mail_from', 'pt_sender_email' );
add_filter( 'wp_mail_from_name', 'pt_sender_name' );

This code, along with your custom sender name and email address, simply replaces the default WordPress sender name and email address.

Categorized in: