function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AdityaRAdityaR 

Governor Limit for Email Messages

Hi,

     Is there a way/method to find out how many email messages have been sent in the current day (out of the daily limit of 1000) using APEX ? or how many are remaining out of 1000 ?

 

 

Thanks

- Aditya

SidzSidz
Hi, If the mail sending is in one single context you can try using static variable. or there should be methods available similar to getDMLStatements which will retrieve sent. The other alternative would be updating some record which will maintain the count for the no of mails sent.
AdityaRAdityaR

Thanks for the prompt reply...your suggestion can be implemeted..but just to be more specific..

 

Does Apex provide a method which gives us the number of emails sent/remaining (out of 1000) for the day ?..something similar to:

 

Limits.getLimitEmailInvocations() returns the total number of email invocations such as sendEmail that can be called in the current context.

 

Thanks

- Aditya

SidzSidz
getEmailInvocations Integer Returns the number of email invocations (such as sendEmail) that have been called in the current context. getLimitEmailInvocations Integer Returns the total number of email invocation (such as sendEmail) that can be called in the current context. you can use the two methods together to get the no of emails used ..