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

How to set up Email Services in Salesforce

Email Services route inbound email to Apex handlers — "when an email lands at this address, run this Apex class." Useful for custom Email-to-Case logic, ticket-creation from forwarded emails, or any inbound-email workflow that goes beyond standard Email-to-Case.

By Dipojjal Chakrabarti · Editor, Salesforce DictionaryLast updated Apr 20, 2026

Email Services route inbound email to Apex handlers — "when an email lands at this address, run this Apex class." Useful for custom Email-to-Case logic, ticket-creation from forwarded emails, or any inbound-email workflow that goes beyond standard Email-to-Case.

  1. Open Setup → Email Services

    Setup gear → Quick Find: Email Services → Email Services.

  2. Click New Email Service

    Top-right.

  3. Set Email Service Name and Active checkbox

    Inactive services don't accept email.

  4. Pick the Apex Class

    Must implement Messaging.InboundEmailHandler. The class's handleInboundEmail method runs when email arrives.

  5. Configure security settings

    Accept Attachments: All / Plain Text Only / None. Authenticate Senders: tick to require SPF / DKIM authentication.

  6. Set Failure Response Settings

    Bounce / Discard / Forward / Hold. What happens when the Apex handler fails.

  7. Save → click into the Email Service → New Email Address

    Generate a unique inbound address. The full address is `<localpart>@<id>.in.salesforceemail.com` or a custom domain.

  8. Provide that address to your senders

    External senders email this address; the Apex class processes each inbound message.

Key options
Apex Classremember

Implements Messaging.InboundEmailHandler. Required.

Accept Attachmentsremember

All / Text only / None. Drives whether the Apex class receives attachment payloads.

Authenticate Sendersremember

Require SPF / DKIM authentication. Recommended for production.

Failure Responseremember

Bounce / Discard / Forward / Hold. What happens when the handler errors.

Gotchas
  • Email Services have daily limits per org — beyond the limit, additional emails are bounced. Monitor Setup → Email Services → Usage.
  • Inbound email is processed in the context of the Apex class — not a real user. Sharing rules and field permissions in the Apex must be explicit; the class runs in system mode unless you restrict it.
  • Bounced senders see a generic Salesforce error message. For custom error responses, build a Failure Response = Forward to a monitored mailbox.

See the full Email Services entry

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