Loading

Truncated Inbound Emails When Using Salesforce Email-to-Case

Publish Date: Jun 2, 2026
Description

When you receive inbound emails to a case in Salesforce Email-to-Case, some content may appear missing, the "View HTML version" may display as incomplete, or email formatting may be broken. This behavior occurs because the email has been truncated by Salesforce field size limits on the Email Message object.

Resolution

By default, the Salesforce Email Message object stores inbound emails in the following fields, each with a maximum character limit:

  • To, CC, BCC Addresses: 4,000 characters per field
  • From Address, Name: 3,000 characters per field
  • Headers, HTML Body, Text Body: 131,072 characters per field
  • Subject: 4,000 characters

When the HTML Body field limit of 131,072 characters is exceeded, Salesforce does not bounce the email. Instead, Salesforce truncates the ending content and stores the remaining email in the available space. Note: This truncation behavior applies only to the HTML Body field. If any other field exceeds its limit, Salesforce bounces the email rather than truncating it.

How to Verify Truncation Using Workbench

You can use Workbench to inspect Email Message field sizes and confirm whether truncation is occurring:

  1. Log in to Workbench and navigate to the SOQL Query option.
  2. Select Email Message as the object.
  3. Run a query using the Email Message Record ID (the ID prefix is 02s). For example: SELECT HtmlBody, Id, TextBody FROM EmailMessage WHERE Id = '02sXXXXXXXXXXXX'
  4. Copy the HtmlBody and TextBody field values into a text editor such as Notepad++ or WordPad.
  5. Use the character count feature to check the number of characters. A character count near 132,072 indicates the email is being truncated by the field size limit.

You can also use Workbench to view field sizes by navigating to the Email Message object in the metadata section.

Common Causes of Truncation

  • Copying text or email templates from Microsoft Word or Notepad, as this often includes hidden characters or extra unnecessary HTML code.
  • Inline CSS styling, break-line tags, table tags, and other HTML markup all count toward the 131,072 character limit.
  • Creating email templates within Lightning Experience helps reduce hidden characters that may be unintentionally copied over. See Create an Email Template in Lightning Experience  for more information.

Limitations and Recommendations

  • There is no option to increase the 131,072 character limit for the HTML Body field.
  • If content needs to exceed this limit, it is recommended to put the text into PDF format and attach it to the email instead.

Additional Behavior for Large Emails

When handling large emails, note the following:

  1. Email-to-Case sends a bounce-back to the sender if the email header exceeds 131,072 characters.
  2. Email-to-Case does not truncate email headers to fit within the limit.
  3. The size limit for email headers is hardcoded and cannot be increased.

Note: Increasing the Email Message field size can affect performance of the Email Message object and any queries or reports run against it, resulting in slower load and display times for the HTML version of the email.

Knowledge Article Number

000386950

 
Loading
Salesforce Help | Article