How to Change WordPress Email From Sender Name Email Settings Without Plugin

Do you know best things about WordPress not only CMS but it is an application framework, it comes with a huge selection of utility functions that make it easy to handle form helpers, validation, file structures, email encoding and much more.

We can easily customize existing actions and filters with WordPress which allows you to override the core WordPress functions with any code you want. The pluggable functions can be included in the functions.php file or in your own plugins to produce new functionality for the functions already used in WordPress.

In this tutorial, we are going to show you how to Change WordPress Email “Send From” Settings. By default, your WordPress installation sends user registration emails from “wordpress@domainname.com” For example, if your blog is at site.domainname.com, emails will come from wordpress@domainname.com.

Change the from email address in WordPress

Here are snippets for changing the “from email address” in WordPress just copy below code and past into theme function.php file:

function phpkida_filter_wp_mail_from($email){
    return "contact@phpkida.com";
}
add_filter("wp_mail_from", "phpkida_filter_wp_mail_from");

Change the email from name in WordPress

Here’s the snippet for changing the “from email name” in WordPress just copy below code and past into theme function.php file:

function phpkida_filter_wp_mail_from_name($name){
    return "PHPkida Team";
}
add_filter("wp_mail_from_name", "phpkida_filter_wp_mail_from_name");

Change the password reset mail title in wordpress

function my_retrieve_password_subject_filter($old_subject) {
    // $old_subject is the default subject line created by WordPress.
    // (You don't have to use it.)

    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    $subject = sprintf( __('[%s] Password Reset'), $blogname );
    // This is how WordPress creates the subject line. It looks like this:
    // [Doug's blog] Password Reset
    // You can change this to fit your own needs.

    // You have to return your new subject line:
    return $subject;
}

Change the password reset mail message in wordpress

function my_retrieve_password_message_filter($old_message, $key) {
    // $old_message is the default message already created by WordPress.
    // (You don't have to use it.)
    // $key is the password-like token that allows the user to get 
    // a new password

    $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
    $message .= network_site_url() . "\r\n\r\n";
    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
    $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
    $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";

    // This is how WordPress creates the message. 
    // You can change this to meet your own needs.

    // You have to return your new message:
    return $message;
}

// To get these filters up and running:
add_filter ( 'retrieve_password_title', 'my_retrieve_password_subject_filter', 10, 1 );
add_filter ( 'retrieve_password_message', 'my_retrieve_password_message_filter', 10, 2 );

1 thought on “How to Change WordPress Email From Sender Name Email Settings Without Plugin”

Leave a Reply

Related Posts: You may like

How to Create and get WordPress Custom Field

How to add post from frontend in wordpress without plugin

WordPress Websites Are SEO Friendly Or Not

How to get last insert id in WordPress

Tools:

Crypto Currency

PHPKIDA provides free online the best real-time crypto market price, news, predictions, index with graphs & historical data for 2000+ coins including bitcoin, ethereum, & altcoins from major cryptocurrency exchanges.

Visite Tool

Icon Generator

PHPKIDA provides free online icon generator. Our icon generator help you to edit, modify, resize and customize icon for your website and applications. Convert to a shap you like add icon border, you can change icon border color, border size, background color, icon shadow, icons color, icon size in your own way and save it as a png image.

Visite Tool

Youtube Video Downloader

PHPKIDA provides Free online YouTube video downloader to download YouTube videos quickly in MP4, 3GP, and more. Search your video and free fast download youtube videos.

Visite Tool

Sign up for weekly update

Milkshake is almost ready. If you're interested in testing it out, then sign up below to get exclusive access.