SINGLE_EMAIL_LIMIT_EXCEEDED. What does it mean?

What does the exception mean? It does not seem to be related to the Number of email invocations limit because of the following line at the end of the log: Number of Email Invocations: 5 out of 10

I also check the email limits before sending an email:

Integer used = Limits.getEmailInvocations();
Integer emailLimit = Limits.getLimitEmailInvocations();
if(used >= emailLimit){
    //print email text instead of email it.

}
else{
    //send email
}

Any clarification on this exception would be much appreciated.
Thanks!

Answer

Per the Governor Limits, you can only send 5000 single emails a day (or less, depending on license).

Using the API or Apex, you can send single emails to a maximum of
5,000 external email addresses per day based on Greenwich Mean Time
(GMT). Single emails sent using the Salesforce application don’t count
toward this limit. 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.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm

Attribution
Source : Link , Question Author : edgartheunready , Answer Author : Pranay Jaiswal

Leave a Comment