- Salesforce Advanced Administrator Certification Guide
- Enrico Murru
- 387字
- 2025-02-23 13:53:35
Monitoring email logs
There's another debug log we should be aware of—the email log. This is required when we want to debug emails sent from Salesforce.
We won't cover the entire email log configuration, but there is something that we sometimes forget to configure when dealing with emails and sandbox organizations: email deliverability.
This simple configuration tells Salesforce which kind of email you want to send from your organization (it works in production organizations as well).
Go to Setup | Email | Deliverability:

You can set the deliverability to any of the following options:
- No access: No email will ever be sent from Salesforce.
- System email only: Only system emails will be sent, such as sharing calculations or Apex error notifications.
- All email: Every kind of email will pass through the Salesforce email servers.
Now that you are sure that the emails are sent, go to Setup | Environments | Logs | Email Log Files, and you will see the following page:

You can request email logs up to 30 days in the past with no more than 7 days per request. Once you request an email log with the only available button on the interface, choose the correct time frame, set up the domain names or email address for the recipients (if needed), and wait for Salesforce to notify you when the ZIP file is ready.
The ZIP contains a CSV with all the emails sent in the given time frame, which you can use to find out whether emails are not being sent, and for what reason. No body or subject is placed in this CSV, just information pertaining to deliverability.