+ Start a Discussion

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 ?



Eyal Filiba