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
EyalEyal 

try catch in sending email - exceeding the 1000 per day email limit

Hi All,

 

I am trying to write the catch part of the try catch

 

I want to send my email via external provider in case my org is exceeding the  1000 emails per day limitation:

 

   catch(exception  ex){
                      if (ex.getMessage()=='SINGLE_EMAIL_LIMIT_EXCEEDED')    
                         }

 

I don't know how to test it ( how to send 1000 emails in a test to get to the limit .... )

 

So, does anyone of you know from their experience if this catch code above will catch this exception ?

 

Thx,

Eyal Filiba