Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Email Attachments entry
How-to guide

Configure email attachment handling end to end

Email attachment behavior is a mix of org settings, channel limits, and storage hygiene. The steps below cover the rollout of attachment handling for a new use case from initial configuration to long-term storage management.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 19, 2026

Email attachment behavior is a mix of org settings, channel limits, and storage hygiene. The steps below cover the rollout of attachment handling for a new use case from initial configuration to long-term storage management.

  1. Confirm Enhanced Email is on

    Setup > Email > Enhanced Email. Check the activation status. If off and the org predates 2017, plan the activation as a separate project; it changes the underlying data model for all email.

  2. Identify the channels

    List which channels will produce attachments: Email-to-Case, Apex email handlers, List Email, Outlook/Gmail integration. Each has its own limits and storage path.

  3. Test inbound limits

    Send a test message with attachments of varying sizes to confirm the 25 MB cap behavior. Verify the bounce message format so support knows how to triage user complaints.

  4. Test outbound limits

    Compose a test email with attachments exceeding 10 MB per file and confirm the error appears in the composer. Train end users on the limits before rolling out.

  5. Configure storage audit query

    Build a SOQL query: SELECT Id, Title, ContentSize FROM ContentVersion WHERE FirstPublishLocationId IN (SELECT Id FROM EmailMessage) ORDER BY ContentSize DESC. Save it as a scheduled report.

  6. Set retention rules

    Define how long email attachments are retained. Common rules: 90 days for Case attachments, 1 year for Opportunity attachments, indefinite for compliance objects. Document the rule clearly.

  7. Schedule the cleanup

    Build an Apex batch or scheduled Flow that deletes ContentVersion records older than the retention window. Test in sandbox; production deletes are irreversible after the Recycle Bin window.

Enhanced Email storageremember

Default modern mode. Email attachments stored as ContentDocument. Recommended for any new org.

Legacy Activity storageremember

Pre-2017 mode. Email attachments stored as Attachment on the Activity. Migrate to Enhanced Email if still active.

Email-to-Case routingremember

Setting on the Email-to-Case service that controls which Case the attachment lands on. Affects how Files appear in the Case Files related list.

Apex handler attachment processingremember

Custom code that decides where binaryAttachments and textAttachments are saved. Common pattern: save as ContentVersion linked to the parent record.

Outlook/Gmail integration attachment syncremember

Per-user setting on the integration. Controls whether attachments are uploaded to Salesforce with the logged email.

Gotchas
  • The 25 MB cap is per inbound message total, not per attachment. Five 6 MB files in one message bounces; one 24 MB file is fine.
  • Apex handlers receive binaryAttachments and textAttachments separately. Code that only processes the first silently drops .txt and .csv attachments.
  • Enhanced Email cannot be turned off once activated. Plan the activation carefully because the underlying storage model changes permanently.
  • Outlook/Gmail integration applies the user's mail client size limit before Salesforce sees the message. Users hitting issues may need to check their mail client first.
  • Storage cleanup deletes ContentVersion, which deletes the file. There is no easy way to selectively delete email attachments; the cleanup must filter accurately to avoid deleting other Files.

See the full Email Attachments entry

Email Attachments includes the definition, worked example, deep dive, related terms, and a quiz.