wp_mail and BCC headers

You could try to debug the output like this:

function test_phpmailer_init( $phpmailer )
{
    echo '<pre>';
        var_dump( $phpmailer );
    echo '</pre>';
    return $phpmailer;
}
add_action( 'phpmailer_init', 'test_phpmailer_init' );

The code in your question is correct, the problem is with your local SMTP application. If you are using a local SMTP server (e.x. Papercut), it only displays the headers that a receiver would see. Since BCC addresses are hidden, you will not see them. So to check to see if BCC addresses are being attached, you can use the function I’ve listed above which will spit out the mail output.

Leave a Comment