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
Shruthi HSShruthi HS 

apex class Messaging.EmailToSalesforceHandler +Too many DML rows: 10001

i am trying to send an email to the salesforce email ID. i get an email which bounces back saying fail to deliver the message. In the failure email i get the message:  
The apex class Messaging.EmailToSalesforceHandler failed due to: System.UnexpectedException: System.LimitException: Too many DML rows: 10001.
i am not retrieving any records or using any batch apex or scheduled classes.
Anyone can help ? why i am getting this issue.
Apoorv Jain 14Apoorv Jain 14
Hi ,

It is standard salesforce limit. Check the debug logs, might be you are using DML operations which is exceeding the limit. Try to use Batch class to avoid these kinds of Limits
karthikeyan perumalkarthikeyan perumal
Hello, 

It is standard salesforce limit.
Total number of records processed as a result of DML statements is 10,000.

Check this link for Apex code best practice
http://wiki.developerforce.com/page/Apex_Code_Best_Practices

Hope this will solve your issue. 

Thanks
karthik