Below links says we can send up to 100 recipients for the To field in Salesforce.


Is it still 100 if I use settargetObjectId in singleEmailMessage? In my case SetTargetobjectId is ContactId.

I need to send 300 emails in singleemailmessage and I can't use MassEmailMessage as I cannot set WhatID to customobjectId in Massemailmessage.

Only contracts, cases, products and opportunities allowed for whatIds in MassEmailMessage

List<contact> lstcon=[Select Id,Name,Email,RecordTypeId,RecordType.Name From Contact where RecordType.Name = 'Customer'];
 List<Id> lstids= new List<Id>();
 for(Contact c:lstcon)
 EmailTemplate et=[Select id from EmailTemplate where name = 'CustomerTemplate' limit 1];

List<Messaging.SingleEmailMessage> mailList = new List<Messaging.SingleEmailMessage>();
for(Integer i=0; i<lstids.size();i++ )
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

1 Answer 1


Short answer is yes. You can use it. When we use setTargetObjectId you can send email to 100 recipients.

Also the 100 mail you are mentioning is for toAddress basically it means create a list add 100 email address in that and then you can use that in SettoAdresses

from the docs

You can specify up to 100 recipients for the To field and up to 25 recipients for the CC and BCC fields in each SingleEmailMessage.

  • Thank you @Tushar Sharma. Is there a way that I could set whatid to custom objectId in massemailmessage.
    – sfdc
    Commented Aug 2, 2017 at 16:21
  • @sfdc I don't think that's possible. You can still post a new question and maybe someone know any hack. Commented Aug 2, 2017 at 16:28

You must log in to answer this question.

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