Setup takes about five minutes. The longer-term work is making sure the recipient inbox is monitored and the application code surfaces enough context for whoever opens the email to act on it.
- Open Apex Exception Email
Setup, then search for Apex Exception Email. The page shows the current list of Salesforce User and External Email Address recipients.
- Add an External Email Address
Under External Email Addresses, click New Email. Add the team distribution list or monitoring inbox. Save.
- Optionally add Salesforce User recipients
Under Salesforce Users, search and add internal users who should receive every exception email.
- Trigger a test exception
Run an anonymous Apex block that throws on purpose (e.g., Integer.valueOf('not-a-number')). Confirm the email arrives at every configured recipient within a few minutes.
- Integrate with a monitoring tool
For production, forward the inbox to PagerDuty, Slack, or a Salesforce Email Service. Plain inbox monitoring rarely scales past a small team.
- Apex Exception Email is unfiltered. High-volume bugs can flood the inbox and produce alert fatigue. Use application-level error handling to suppress expected exceptions.
- Emails can lag the underlying exception by seconds to minutes, especially in async contexts. Do not rely on email latency for incident response.
- Test exceptions do not send email. Failures only show in the test runner. Production monitoring cannot be validated through Apex tests alone.
- Very large orgs can hit the daily email send limit if exception volume spikes. Build a durable pull-based monitoring layer alongside email.