Currently I have an Apex trigger on the Account object, such that when the Account name is modified, it sends an email to a specific list of email addresses defined in a custom setting. This is all working fine - however, for some reason, the person who made the update to the Account Name (i.e. the person initiating the trigger code) will always get copied on the email that is sent out to the recipients.
For example, below is a code snippet from my trigger ... even if I just run the code below in the Developer Console, the user running the code will always get copied in the email (in the CC).
List singleEmailList=new List(); // the email addresses will come from custom setting String[] toAddresses = new String[] {'[email protected]'}; // Email Test 1 Messaging.SingleEmailMessage singleEmail1 = new Messaging.SingleEmailMessage(); singleEmail1.setSenderDisplayName('Salesforce Support'); singleEmail1.setReplyTo('[email protected]'); singleEmail1.setSubject('Test Email Only'); singleEmail1.setPlainTextBody('Test Email Only ... '); singleEmail1.setBccSender(false); singleEmail1.setToAddresses(toAddresses); singleEmailList.add(singleEmail1); Messaging.SendEmail(singleEmailList);
Has anyone experienced this? I have looked in various configuration settings but found nothing. The bccSender flag doesn't seem to work either.
Nevertheless, if I run the code in my Developer Edition sandbox, it works fine (running user is not copied)! Not sure if there is some configuration with the Salesforce instance/sandbox at my work somehow?
Any suggestions or workarounds would be appreciated ...
Many thanks! Jeffrey
toAddress
(3) Do you (or the person referenced in the OP) have bcc setup in your Setup | Personal Info | Email Settings ?