1. Database.Stateful interface at the top which will maintain state throughout the execution 2. global Trans_List which can be used to retain record so that we can get the processed record in finish method.
For information on governor limits please check with below links:
May I suggest you please check with below code for the same which might help you accelerate further with above requirement.
There are two things which I have added.
1. Database.Stateful interface at the top which will maintain state throughout the execution
2. global Trans_List which can be used to retain record so that we can get the processed record in finish method.
For information on governor limits please check with below links:
- https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_messaging.htm#apex_System_Messaging_sendEmail
- https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm#email_limits_section
Hope this helps.Thanks,
Nagendra.