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
Prakash GBPrakash GB 

does email relay over come SINGLE_EMAIL_LIMIT_EXCEEDED..?

i need to send more than 10 emails by apex code from my developer- org. does email relay helps? or any other way to achieve this?
Arpit Jain7Arpit Jain7
Hello Prakash,

No I don't think email relay can be used to overcome Single_Email_Limit_Exceeded error. You can refer below link for more details on Email Relay

https://help.salesforce.com/articleView?id=000005793&type=1

Hope it helps!!

Thanks
Arpit
 
Prakash GBPrakash GB
Hi Arpit,

i sthere any other way that i can over come email limit.?
Arpit Jain7Arpit Jain7
HI Prakash,

There is a limit of 10/day to use single email method to send emails. But you can use it to send more then 10 email/day for that you need to attachemed more then person email id and then use send email method of single email class to send email in bulk.

I think you can try below sample code and it should help

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
Arpit
Arpit Jain7Arpit Jain7
Hello Prakash,

I hope above solution provided helped you. If it does please mark it as Best Answer, so that it can help others also with the same problem.

Thanks
​Arpit