I have been watching how to implement the batch for sending more than 10 email but I get errors. When I send emails I have a limit 5 and also are sent several times to the same user email
global class SendBatchClass implements Database.Batchable<sObject>, Database.AllowsCallouts{
String query = '';
global Batchname(){
}
global SendBatchClass(String newBodyBatch,...){
this.body = newBodyBatch;
try{...}
catch(){...}
}
global Database.QueryLocator start(Database.BatchableContext BC) {
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<Contact> scope) {
SES sesEmail = new SES(as3.key,as3.secret);
for(sObject s: scope){
sesEmail.sendEmail(subRecipients,sender,subject,newBody);
}
}
global void finish(Database.BatchableContext BC) {
}
}