Sending Site Notifications to a BCC Address

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy but don’t provide support for code customizations or 3rd party development.

For extra guidance, please see WPBeginner’s tutorial on adding custom code.

Overview

Would you like to add a BCC email address to all emails sent from your WordPress site? Adding a BCC email address is a great way to check the notifications you’re sending your users without disclosing your email address.

In this tutorial, we’ll show you how to use a PHP snippet to ensure all your site’s outgoing emails are also sent to a specific BCC email address.

Note: Be sure to install and activate the WP Mail SMTP plugin on your site before adding the code snippet provided in this tutorial.

Setup

Simply copy and paste this snippet to your site. On line 2, you’ll need to replace [email protected] with your desired BCC email address.

function wpms_add_bcc_email_address( $args ) {
$args['headers'][] = 'bcc: [email protected]';
return $args;
}
add_filter ( 'wp_mail', 'wpms_add_bcc_email_address');

That’s it! Now you know how to successfully add a BCC email address to all the emails sent from your WordPress site.

Next, want to explore more ways to customize your WP Mail SMTP setup? Be sure to take a look at our other code snippets for more customization options.