You need to sign in to do that
Don't have an account?
SINGLE_EMAIL_LIMIT_EXCEEDED : Using SetTargetObjectId(contact.Id) on SingleEmail Message.
Dear Members,
I came accross a very surprising(annoying as well) problem when i tried to send the EMail using SingleEmailMessage.
I used setTargetObjectId(User.Id) and send near about 800 emails from my development org. My Email Limit remained as it is.
But when I used setTargetObjectId(Contact.Id) and tried to send the emails then i came Accross SINGLE_EMAIL_LIMIT_EXCEEDED.
Can anybody suggest and Provide input on this as salesforce documentation provide contradictory info in below Link:
http://www.salesforce.com/us/developer/docs/pages/Content/pages_apex_governor_limits.htm
"There’s no limit on sending
individual emails to contacts, leads, person accounts, and users in your organization directly from account, contact,
lead, opportunity, case, campaign, or custom object pages."
"You can send an unlimited amount of email to your organization’s
internal users, which includes portal users."
Thanks In Advance,
Ghanshyam Bhatt
For the first statement, the doc also says:
Which probably means not Apex but the Salesforce User Interface. I understand that you can send unlimited individual emails to Accounts, Contacts etc. through the User interface but not through Apex.
Hope this helps.
Regards,
Satish Kumar
All Answers
For the first statement, the doc also says:
Which probably means not Apex but the Salesforce User Interface. I understand that you can send unlimited individual emails to Accounts, Contacts etc. through the User interface but not through Apex.
Hope this helps.
Regards,
Satish Kumar
There is a point there that
But I guess you are sending 800 emails at a time. Please make sure of that.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
I sent 1 email using 1 singleEmailMessage instance and i created 800 such instances to it. So, i send 800 emails.
After reading your problem, what comes in mind is
I am providing a pseduo cose for what i did. It may Avoid confusion.
1) Create 800 instances of singleEmail Messages.
2) Put these Instances into the List.
3) as sendEmail() takes list as an argument so i provided list.
this shot near about 800 emails, i just one call of send email.
So, Technically i do it 2 days back.\
Thanks.
I dont think you can send more than 10 emails to external user @ DE Org.
They enforcea hard limit of DE org and 1000/day email limit is for UE.
In Developer org, you cannot send more than 10 mails at a time. Please check that.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
Friends, i am using setTargetObjectId(user.id) for sending email. So salesforce considers it as the internal message. and it doesnot enforces the limit.
Because initially you said you are setting contact.id!
Posting the code will really help others to debug the issue, because its pretty clear from the error message that you are hitting limit.
Use ful links
http://kb.internetcreations.com/articles/Troubleshooting/Sending-e-mail-with-new-comment-failed-SINGLE-EMAIL-LIMIT-EXCEEDED/?fs=Search&l=en_US&pn=1
http://sanketsarang.blogspot.in/2013/05/salesforce-single-email-limit-exceeded.html
https://success.salesforce.com/answers?id=90630000000gvmlAAA
You can email a maximum of 1,000 external email addresses (non-users) each day (based on GMT) via the API/Apex regardless of your Salesforce.com edition. Unfortunately this limit does not scale with user count like most SFDC limits. The single and mass email limits don't take unique addresses into account. For example, if you have johndoe@example.com in your email 10 times, that counts as 10 against the limit.
Emails sent via the UI (Send an Email button), Workflow and Auto-Response Rules do not count against this limit. Conversely, inbound email limits do scale by 1,000 emails per Salesforce user license.
Contact your Salesforce.com administrator, Salesforce.com account representative, or Salesforce.com technical support to obtain an increase to this limit or for clarification on the limit.
>>https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm
"If you use SingleEmailMessage to email your org’s internal users, specifying the user’s ID in setTargetObjectId means the email doesn’t count toward the daily limit. However, specifying internal users’ email addresses in setToAddressesmeans the email does count toward the limit."
>>https://help.salesforce.com/articleView?id=000323568&type=1&mode=1 (https://help.salesforce.com/articleView?id=000323568&type=1&mode=1)
"Emails sent using 'setTargetObjectId()' set against the User object do not count against the 'SingleEmailMessage' limit."
Hope this clears the doubts for many of us.
Thanks
Swapnil Srivastava