1

My org have a lot of contacts - around 2000. All of these contacts have e-mail address. I need to send an e-mail to each of them. An admin will enter a body (on a VF page) and click "send e-mails" button. The question is will this work? In General Email Limits is a note

There’s no limit on sending individual emails to contacts, leads, person accounts, and users in your organization directly from account, contact, lead, opportunity, case, campaign, or custom object pages.

So is it a case? Can I send 2000 e-mail to my contacts (one e-mail to each contact)?

What should be written in controller? I found MassEmailMessage Methods. There is a setTargetObjectIds(ID[]) method. But I'm not sure what does

All email must have a recipient value of at least one of the following: toAddresses ccAddresses bccAddresses targetObjectId targetObjectIds

mean. Anyone?

1 Answer 1

2

You will need to use SetTargetID method with ID array patameter as the contact Ids .The email limits wont apply if you use SetTargetID method .Dont use toaddress method onstead use setTargetId .

Using setTargetId method email limit wont count against governor limit

6
  • That is it what I thought about sending e-mails to contacts. Thanks! Commented Jul 29, 2014 at 11:47
  • Mark the answer as answered if that helped Commented Jul 29, 2014 at 12:34
  • I will after I prove this concept. I didn't have a chance to check this. Commented Jul 31, 2014 at 18:28
  • @MohithShrivastava Are you sure? Because when I tried MassEmailMessage and SingleEmailMessage limit started reflecting and both mass email and single email started reducing. Commented Apr 1, 2016 at 14:24
  • Ya its documented below in the limit guide resources.docs.salesforce.com/200/15/en-us/sfdc/pdf/… Commented Apr 1, 2016 at 14:58

You must log in to answer this question.

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