I am actually trying to send email through apex. So I got this link https://help.salesforce.com/s/articleView?id=000334302&type=1.
So I tried it in my dev org where the limit is 15. So I am using targetobjectObjectId as contact Id in Messaging.SingleEmailMessage. But after sending email. I could see that the count is reducing. Can someone help me here?
In the above link it says like below:
Each organization can send single emails to a maximum of 5,000 external email addresses per day.
"External emails" refers to any email that's not associated to a Contact, Lead, or User. There’s no limit on sending single emails to contacts, leads, person accounts, and users in your org directly from account, contact, lead, opportunity, case, campaign, or custom object pages.
But why is my limit reducing in my Org? Please not that this piece of code I am trying in my Dev Org.
Below is my piece of code
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setTargetObjectId(targetObjectId);//Contact Id
email.setWhatId(whatId); Account Id
email.setTemplateId(templateId);//Email template Id
email.setCcAddresses(ccRecipientList);//List of Contact Ids
if(attach != null)
email.setFileAttachments(attach); //Attachments if any