You need to sign in to do that
Don't have an account?
Cool Guy
SINGLE_EMAIL_LIMIT_EXCEEDED
Hi,
I have a small issue regarding emails.
I have Enterprise Edition with 447 user Licences and I have nearly 1,00,000 Accounts in my Account Object, I need to send an email to those Accounts at a time.
To send Email I scheduled a class a Batch Class , Here is the Batch Class .
global class SurveyBatchProcessForActiveAndInactive implements Database.Batchable<Opportunity>
{
//Query Opportunity fields with active,inactive stages and Department is Aus and also RecordType is AUS
global Iterable<Opportunity> start(Database.BatchableContext BC)
{
Opportunity[] opp=[select id,Account.Person_Email__c,Account.Id from Opportunity where Account.Person_Email__c != Null];
system.debug('Opportunity Size'+opp.size());
return opp;
}
//sent email to opportunity clients those are returned by start method
global void execute(Database.BatchableContext BC, List<Opportunity> opprecords)
{
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
//To sent email to clients
for(Opportunity opp:opprecords)
{
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
List<String> toAddresses = new List<String>();
toAddresses.add(opp.Account.Person_Email__c);
String htmlbodystring = 'Some Text goes Here'+opp.id;
email.setToAddresses(toAddresses);
email.setHTMLBody(htmlbodystring);
email.setSubject('Test');
mails.add(email);
}
Messaging.sendEmail(mails);
}
//Life Cycle method of Batch Class
global void finish(Database.BatchableContext BC){
}
}
While running this class, I got SINGLE_EMAIL_LIMIT_EXCEEDED error. How to Solve this issue please help me
I have a small issue regarding emails.
I have Enterprise Edition with 447 user Licences and I have nearly 1,00,000 Accounts in my Account Object, I need to send an email to those Accounts at a time.
To send Email I scheduled a class a Batch Class , Here is the Batch Class .
global class SurveyBatchProcessForActiveAndInactive implements Database.Batchable<Opportunity>
{
//Query Opportunity fields with active,inactive stages and Department is Aus and also RecordType is AUS
global Iterable<Opportunity> start(Database.BatchableContext BC)
{
Opportunity[] opp=[select id,Account.Person_Email__c,Account.Id from Opportunity where Account.Person_Email__c != Null];
system.debug('Opportunity Size'+opp.size());
return opp;
}
//sent email to opportunity clients those are returned by start method
global void execute(Database.BatchableContext BC, List<Opportunity> opprecords)
{
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
//To sent email to clients
for(Opportunity opp:opprecords)
{
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
List<String> toAddresses = new List<String>();
toAddresses.add(opp.Account.Person_Email__c);
String htmlbodystring = 'Some Text goes Here'+opp.id;
email.setToAddresses(toAddresses);
email.setHTMLBody(htmlbodystring);
email.setSubject('Test');
mails.add(email);
}
Messaging.sendEmail(mails);
}
//Life Cycle method of Batch Class
global void finish(Database.BatchableContext BC){
}
}
While running this class, I got SINGLE_EMAIL_LIMIT_EXCEEDED error. How to Solve this issue please help me
Radnip
Salesforce isn't designed as a mass emailing tool. If you need to send a large amount of emails use a mass emailing service like ExactTarget or Eloqua etc.
Cool Guy
Thank you for your reply. With Out using those external tools How can I solve this Issue.