Skip to main content Skip to navigation Skip to footer

Changing the From Name & Email for Transactional Notifications

Updated

Due to a restriction in the WordPress wp_mail() function, it is not possible to change some of the header information for transactional notifications. This includes the ‘From’ name and email address, and ‘CC’ and ‘BCC’ details. In order to get around this you may need to use a function (see below) to change the default name and email address of your outgoing notifications. Please be aware though, that by doing this, you will most likely globally affect all email notifications that WordPress sends out, including those from WordPress, BNFW, and other plugins. Please test appropriately before adding the below code to your website.

To change the default From name and email address in WordPress, paste this code in your functions.php file and change the relevant information.

// Change Default Email Address
function bnfw_change_email_address($email) {
return "email@yourdomain.com";
}
add_filter('wp_mail_from', 'bnfw_change_email_address');

// Change Default Email 'From' Name
function bnfw_change_email_from($from_name) {
return "Your Name";
}
add_filter('wp_mail_from_name', 'bnfw_change_email_from');

It is also worth noting that in order to reduce the chances of your server flagging your notifications as SPAM, you should always ensure that the domain in your ‘From’ email address is the same domain or sub-domain that your website is sending the email out from.

Privacy Overview

This website uses cookies so that it can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to this website and helping employees to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

This website uses the Stripe Payment Processor. Cookies from Stripe are required in order for this website to provide eCommerce functions, such as to accept payments.

This website uses YouTube to host and display videos relating to the operation of this plugin and forms part of the documentation. Use of cookies from YouTube is required in order to fully document or explain elements of a product.

PHPSESSID - This cookie is native to PHP applications. The cookie is used to store and identify a users' unique session ID for the purpose of managing a user's session on the website. The cookie is a session cookies and is deleted when all the browser windows are closed.