2

If the option Compliance BCC Email is enabled, will emails sent from APEX classes be bcc'd as well? Also I am assuming it includes mails from Workflows.

Thanks Nawshine

1
  • 2
    this is readily testable using anonymous apex - did you try that?
    – cropredy
    Commented Feb 24, 2016 at 2:53

1 Answer 1

2

Yes, I just tested it and it for sure send BBC email even if the mail is send from APEX.

Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
// Set recipients to two contact IDs.
// Replace IDs with valid record IDs in your org.
message.toAddresses = new String[] { '[email protected]' };
message.optOutPolicy = 'FILTER';
message.subject = 'Opt Out Test Message';
message.plainTextBody = 'This is the message body.';
Messaging.SingleEmailMessage[] messages = 
    new List<Messaging.SingleEmailMessage> {message};
         Messaging.SendEmailResult[] results = Messaging.sendEmail(messages);
if (results[0].success) {
    System.debug('The email was sent successfully.');
} else {
    System.debug('The email failed to send: '
          + results[0].errors[0].message);
}

It just exclude the system email.

https://help.salesforce.com/HTViewHelpDoc?id=admin_compliancebcc.htm&language=en_US

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .