Loading

Truncated Inbound Emails When Using Salesforce Email-to-Case

Fecha de publicación: Jun 19, 2025
Descripción

You are receiving inbound emails to your case however, some content appears to be missing or the "View HTML version" is showing as incomplete or formatting is missing. It appears as if the email has been truncated. 

Solución

By default the Salesforce Email Message object where your inbound emails are stored can only contain the following characters per their related fields:
 

To, CC, BCC Addresses 4000 characters per field
From Address, Name 3000 characters per field
Headers, HTML Body, TEXT Body 131,072 characters per field
Subject 4000 characters

You can use Workbench to view any Salesforce field size. Once logged in, find the Email Message object.

If the HTML Body limits are exceeded, rather than bouncing the email as a failure, Salesforce truncates the ending content and stores the email in the available space. Also, if you are using a forwarding rule on your email server, you retain a copy of the full email. Note: This pertains only to the 'HTML body' field. If the excess is on any other field, Salesforce will bounce and not truncate.

Referring to the issue described earlier of inbound emails being truncated, you can also use Workbench to validate if this is the issue you're facing with your inbound email2case. Find the Email Message Id of the record you believe to have an issue (prefix is 02s) and using Workbench select the SOQL Query option, select Email Message as the object. You can select what fields you want to include in the query result or you can use the below query + your Email Message Record ID

Query:
SELECT HtmlBody,Id,TextBody FROM EmailMessage WHERE Id = '02sXXXXXXXXXXXX'

From this point, you will want to check both the HtmlBody and TextBody fields by copying the content into NotePad++ (Word, WordPad are all fine also) and using the character count feature to determine the number of characters in each field. You will usually see around the 132,072 characters mark if the email is being truncated by the field size limit. 
 
This limit can be reached inadvertently by copying text or templates over from Word or NotePad, since the copy will contain hidden characters or extra unnecessary HTML code.  Please note that this character limit counts all HTML tags within your email's HTML body. This includes inline CSS styling, break-line tags, table tags, etc.  Creating email templates within Lightning will help reduce the hidden characters being copied over.  See Create an Email Template in Lightning Experience for more information.
 
There is no option to obtain an increase above the limit.  If there is a need to go beyond this limit, it is recommended to put your text into .PDF format and attach it to your email instead. 

When dealing with large emails, please keep in mind the following: 
  1. Email-to-Case will send a bounce-back to the sender if the email header has over 131,072 characters.
  2. Email-to-Case will not truncate the header to fit the 131,072 character limits.
  3. The size limit for email headers is hardcoded and cannot be increased.

Note: Performance of the Email Message object, as well as any queries or reports run against the object or records, can be affected by increasing the field size. This can result in slower Email Message load times and display times for the HTML version of the email.


Número del artículo de conocimiento

000386950

 
Cargando
Salesforce Help | Article