You need to sign in to do that
Don't have an account?
Indeevar
Handling Messaging.SingleEmailMessage apex governor limit of 10
HI
There is a requirement to send emails to contact owners for birthdays of their
respective contacts. So we are calling Messaging.SingleEmailMessage method within an Apex class
in a loop. But in the Apex class there is a limitation that this method cannot be called more
than 10 times. Contact Owners are more than 50 though. The loop runs this many times .
How to handle this governor limit issue?
Messaging.SingleEmailMessagemail objects, and put them in Messaging.SingleEmailMessagemail array.
Then put that array in the sendEmail method.
you've mentioned that you should put it in a loop and put the instantiated object,but how are we gonna put it in an array? sorry im a newbie to salesforce.
I would really appreciate it if you could give us a simple sample code on how to do this.
thank you very much