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
Ramana123Ramana123 

EmailException:SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, Email limit exceeded: []

what the wrong this code it is showing the above error please help in this 


global class LeadDays7 implements Database.Batchable<SObject>{
    List<Lead> listRecords = new List<Lead>();
    
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        String query = 'Select Id,Name,Email,CheckBox__c,Leadage__c From Lead Where Leadage__c > 7 LIMIT 10 ';
        return Database.getQueryLocator(query);
    }
     
     global void execute(Database.BatchableContext BC, List<Lead> scope){
           System.debug('aaaaaaaaaaaaaaaaaaaa'+scope);
        
                     for(Lead leads : scope)
                    {
               if(leads.Email != NULL)
               {
                   leads.CheckBox__c = TRUE;
               }
            listRecords.add(leads);          
        }
         update listRecords;
     

        List<String> emailList = new List<String>();
        System.debug('aaaaaaaaaaaaaaaaaaaa'+scope);
        for(Lead ld: scope) {
            if(ld.Email != NULL) {
                emailList.add(ld.Email);
            }
        }
        System.debug('bbbbbbbbbbbbbbbbbbbbb'+emailList);
         Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
            email.setToAddresses(emailList);
            email.setSaveAsActivity(false);
            email.setSubject('Age is 7 days');
            email.setPlainTextBody('Batch Update for Opportunity Close Date has been completed');
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
            
     }    
    global void finish(Database.BatchableContext BC){
 
}
}
AbhishekAbhishek (Salesforce Developers) 
Try the suggestions mentioned in the below discussions,

https://salesforce.stackexchange.com/questions/130447/how-can-be-avoided-error-single-email-limit-exceeded-email-limit-exceeded-if-nee

https://developer.salesforce.com/forums/?id=906F00000008obmIAA


Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
Ramana123Ramana123
Thanks for the reply Abhishek, In those links there is not much information in the sense means how to send Can you help in those code please,