You need to sign in to do that
Don't have an account?
Kavya Sarraju
Error:SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, Failed to send email: []
Hi All,
By using Single-email-Message i am sending email to internal users through apex but i am getting error.
Error:SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, Failed to send email: []
Please help me out on this error
Thanks
By using Single-email-Message i am sending email to internal users through apex but i am getting error.
Error:SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, Failed to send email: []
Please help me out on this error
Thanks
Hi Kavya,
SingleEmailMesssage is having limits in Salesforce. Using the API or Apex, you can send single emails to a maximum of 1,000 external email addresses per day. For more about limits refer https://login.salesforce.com/help/pdfs/en/salesforce_app_limits_cheatsheet.pdf
It is possible that you are calling the Messaging.sendEmail(yourSingleEmailMessage); in a loop. To avoid this you can add these emails in List<SingleEmailMeassage> e.g. mails inside the loop and use Messaging.sendEmail(mails) outside the loop.
You can hit email server 10 times per transaction ,So if you will call send or SendEmail method inside for loop it wil hit the server more then 10 times it will throw you error .
So here it will hit the email server once per tansaction .
Let me know if it helps !!
Thanks
Manoj
eg:
Thanks for suggesting me,
As I have already writen the code same as like above you said. But still I am facing the same problem.
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
list <string> ccAddresses = new list<String> {'test@gmail.com'};
mail.setTargetObjectId(con.id);
mail.setCCAddresses(ccAddresses);
mail.setReplyTo('business@3w01u74qjv64wenut3g4mpkty9r31s5yyyttwk8gi6q2y36em.9-114ixeaa.ap1.apex.salesforce.com');
mail.setSubject(EmailSubject);
mail.setHtmlBody(EmailBody);
mail.setplainTextBody(TextEmail);
mail.saveAsActivity = false;
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
Can you plz post your code and tell the exact error you are getting .
If notpossble to pste the code plz send to my email (manojjena20@gmail.com) fo rwhich I can helpo you to solve the issue .
Is there any possibility that you have written above code in for loop ?? Can you please share the code and exact error message ?