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
Bhupathi YadavBhupathi Yadav 

Sending bulk emails using batch apex

I want to send bulk emails (like 10000) using batch apex .

Is there an limitation while sending mails using Messaging.SingleEmailMessage.
If it is not, then tel me which is the the way to achieve this?
karthikeyan perumalkarthikeyan perumal
hello, 

kindly refer  the below artical for sending more then 10 email using Batch apex, 

http://forceguru.blogspot.in/2011/03/how-to-send-more-than-10-e-mails.html

Thanks
karthik
 
Nirdesh_BhattNirdesh_Bhatt
Hi Bhupathi,
Please check below links

http://http://forceguru.blogspot.com/2011/03/how-to-send-more-than-10-e-mails.html
http://devendranatani.blogspot.com (http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm)
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm​

 
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
for(User portalUser :lstPortalUser) {
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
string body = 'Hi '+ portalUser.LastName;
mail.setSubject('Test Subject');
mail.setTargetObjectId(portalUser.Id); mail.setSaveAsActivity(false);
mail.setHtmlBody(body); mails.add(mail);
}
Messaging.sendEmail(mails);

Thanks,
Nirdesh.