Is there a way to change who receives Apex exception mails?
Salesforce Classic: Setup | Quick find | Apex Exception Email
Lightning Experience: Gear Icon | Setup | Quick find | Apex Exception Email
Add Salesforce User or Add Non Salesforce User email address | Click Save
The entered email addresses then apply to all managed packages in the customer's org.
After setup “Apex Exception Email”, now if any apex exception occurs on the Salesforce org by any user then this defined user will receive an apex exception email.
You can also configure Apex exception emails using the Tooling API object ApexEmailNotification.
A development team has deployed a custom Apex trigger to production that processes incoming lead records. One evening, a data import creates records that expose an edge case in the trigger's logic, causing an unhandled exception. Without Apex Exception Email configured for the team's shared inbox, only the individual developer who last modified the trigger receives the error notification — and they are on leave. By the time the issue is discovered the next morning, hundreds of lead records have failed to process. Configuring Apex Exception Email to notify a shared team inbox or a dedicated on-call email address ensures that production Apex errors are caught and triaged immediately, regardless of individual availability.
Salesforce sends two types of notification mails when potential issues with APEX code are detected:
- ApexEmailNotification (Tooling API Object Reference): https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexemailnotification.htm
- What Happens When an Apex Exception Occurs?: https://help.salesforce.com/articleView?id=code_apex_exceptions.htm&type=5
- Control Who Receives Flow and Process Error Emails: https://help.salesforce.com/s/articleView?id=sf.flow_troubleshoot_error_email.htm&type=5
- Apex Governor Limits (Salesforce Developer Documentation): https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm
- Apex Exception Handling (Salesforce Developer Documentation): https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_exception_definition.htm
000385876

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.