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
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