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
Abhilash Mishra 13Abhilash Mishra 13 

Single Email Limit exceed on sending only 15 emails

while sending emails to contacts i get single email limit exceed error. governer limit for sending single mail is 1000 per profile.
code is 
public class emailsender{


public void sendyourmail(){

  
  List<Messaging.SingleEmailMessage> mails = 
  new List<Messaging.SingleEmailMessage>();
 list<contact> li = [select id, name , email from contact limit 50];
  for (contact myContact :li) {
    if (myContact.Email != null && myContact.Name != null) {
        Messaging.SingleEmailMessage mail =   new Messaging.SingleEmailMessage();
           mail.setReplyTo('myemail@demo.com');
              mail.setSenderDisplayName('dummyemail');
             mail.setTargetObjectId(myContact.id); 
             mail.setTemplateId('00X28000000uJtC');    
            mails.add(mail);
    }
  }

  Messaging.sendEmail(mails);
      
    
    
    
    }

}
Best Answer chosen by Abhilash Mishra 13
AshlekhAshlekh
Hi,

Hope below link will help you 

http://salesforce.stackexchange.com/questions/17133/single-email-limit-exceeded-salesforce-very-frequently

-Thanks
Ashlekh Gera

All Answers

AshlekhAshlekh
Hi,

Hope below link will help you 

http://salesforce.stackexchange.com/questions/17133/single-email-limit-exceeded-salesforce-very-frequently

-Thanks
Ashlekh Gera
This was selected as the best answer
SalmanSalman
Hii Abhilash Mishra 13,

can you please check this app for avoiding  email limit in Salesforce
 
MassMailer lets you send unlimited emails from within Salesforce, no matter which edition you use. Built on the Salesforce platform, it has all the mass email features you’ll ever need.Build, send, and schedule professional-looking emails with a simple to use email Wizard within Salesforce – no HTML experience required.

You can try this app by installing from appexchange- MassMailer 

For Developer's Guide please click here-Developer's Guide

You can learn more details about the product on this website -Link