[SalesForce] Hiding settargetObjectId while sending email..

Hi I have used contact as settargetObjectId and whenever an email is sent this contact emailid also get copied in the email list..

Is there any way to put this contact emailid(settargetObjectId ) in bcc list so it is always hidden from the recepient.

Also please note i am using template to send out email notifications..

Please help…!!!

Best Answer

You cannot do this.

setTargetObjectId(id) is used to send email to Lead, Contact or User. It is defined for main email recipient (same as toAddress(String[]) when using template. It will always in "To:"

Related Topic