1

I have developed a pretty cool, reusable piece of apex code that allows a user to define which fields on a given object that are of interest when field values change. When a field changes on an object that a user is interested in, the change data is archived to a custom object and an email is sent out. I am hitting the limit of 1,000 apex emails per day. I was wondering if there was a way to take a proactive approach to monitor the number of emails sent in a 24 hour period. I see there is a Limits apex class but that only shows the current count for a given transaction. Does anyone know of a method that I can use to get the current count of emails send in a 24 hour period rather than me writing something that is custom to keep track of a count? I can't believe SFDC limits us to only 1,000 emails. Kinda defeats the purpose of doing real time alerting via email. I read somewhere I may be able to create an internal email in SFDC that doesn't count against this limit. I may have to do that instead if I can't find a viable work around. Thanks, Ryan

1 Answer 1

1

Problem is that you are setting up your email request as external address rather than email your internal users instead.

You can send an unlimited amount of email to your organization’s internal users, which includes portal users. Resource Link

Correct way to doing it:

Messaging.SingleEmailMessage emailMsg = new Messaging.SingleEmailMessage();  
emailMsg.setTargetObjectId(internalUserId);
//must be false if sending to internal user    
emailMSg.saveAsActivity = false; 
emailMsg.setSenderDisplayName('sender name');  
emailMsg.setSubject('some subject');  
emailMsg.setBccSender(false);  
emailMsg.setUseSignature(false);  
emailmsg.setPlainTextBody('email body');  
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { emailMsg });

Resource Link

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .