1

MassEmailMessage should support 250 IDs per email according to documentation.

As of recently, I'm experiencing errors when there are more than 10 users. The SendEmailResult result is always false, with the message Too many target object ids.

Have there been some platform changes that I'm not aware of?

Example code block:

List<Id> userIds = new List<Id>{
    // more than 10 user Ids
};
Messaging.MassEmailMessage massEmail = new Messaging.MassEmailMessage();
massEmail.setTargetObjectIds(userIds);
massEmail.setSaveAsActivity(false);
massEmail.setTemplateId(templateId);
List<Messaging.Email> emails = new List<Messaging.Email>{massEmail};
Messaging.SendEmailResult[] results = Messaging.sendEmail(emails, false);
  • Is it a Developer Edition org? – Saroj Bera Mar 6 '18 at 10:25
  • 1
    It's Enterprise Edition. It can't be Developer Edition because that edition can not have more than a couple users. – ipavlic Mar 6 '18 at 12:11
3

Support says that Salesforce previously hardcoded the number to 250, but have since started treating this as a limit based on the type of the org. For trial orgs, the undocumented limit became 10.

They quoted email limits section which states:

In Developer Edition orgs and orgs evaluating Salesforce during a trial period, you can send mass email to no more than 10 external email addresses per day. This lower limit doesn’t apply if your org was created before the Winter ’12 release and already had mass email enabled with a higher limit. Additionally, your org can send single emails to a maximum of 15 email addresses per day.

However, this previously did not apply, as stated in another section:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.