Magento adding BCC is not working

Magento adding BCC is not working

October 14, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento adding BCC is not working

Understanding BCC in Magento: Ensuring Emails Reach the Right Recipients

In Magento, sending emails is a critical part of any e-commerce operation. You’ve written an excellent function to send fraud-related order emails, but you’re facing a challenge with adding Blind Carbon Copies (BCC). Let’s dive into why this might not be working and how to resolve it.

The Problem: BCC Not Being Added

You’ve correctly added the BCC functionality inside your sendFraudEmail method:

$copyTo = explode(",", Mage::getStoreConfig(self::XML_PATH_EMAIL_BCC));
if (!empty($copyTo) && isset($copyTo)) {
    // Add bcc to customer email
    foreach ($copyTo as $bccemail) {
        $mailTemplate->addBcc($bccemail);
    }
}

The issue lies in the location of this code. It’s being executed before you’ve actually set the recipient of the email:

$obj->sendTransactional($templateId, $sender, $customer_email, customer_name, $vars, $storeId);

When you call addBcc, it adds the BCC to the internal storage of the email template object. However, this is not sufficient if you haven’t set the recipient yet.

The Solution: Timing Is Everything

To ensure that the BCC is properly added and sent with your email, you need to add the recipients after setting up the BCCs. Rearrange your code like this:

$copyTo = explode(",", Mage::getStoreConfig(self::XML_PATH_EMAIL_BCC));
if (!empty($copyTo) && isset($copyTo)) {
    // Add bcc to customer email
    foreach ($copyTo as $bccemail) {
        $mailTemplate->addBcc($bccemail);
    }
}

try {
    $obj->setReplyTo($sender['email'])->setTemplateSubject($mailSubject)->sendTransactional(
        $templateId,
        $sender,
        $customer_email,
        customer_name,
        $vars,
        $storeId
    );
} catch (exception $e) {
    Mage::log("something went wrong.." . $e->getMessage());
}

By moving the BCC addition after setting up the email object but before sending it, you ensure that both the recipient and the BCC are properly set.

Best Practices for Email Sending

Remember to consider these best practices when handling emails in Magento:

  1. Always log exceptions to capture any issues that arise during email sending.
  2. Use system-wide email templates rather than store-specific ones to maintain consistency.
  3. Ensure your self::XML_PATH_EMAIL_BCC configuration is set correctly in the admin panel.

Conclusion

Adding BCCs to emails in Magento requires a careful consideration of the order of operations. By setting up the recipients and BCCs before sending the email, you can ensure that your sensitive information reaches its intended recipients without fail.

For more advanced email handling in Magento, I recommend exploring Laravel Company’s guides on email templates. They provide a comprehensive overview of how to manage emails effectively in the Magento ecosystem.

Remember, every detail matters when it comes to your customer’s experience. Ensuring emails reach everyone who needs them is a critical part of maintaining trust and satisfaction with your online store.

Themes Configuration Email Orders

Our network