Why are Inbound Emails being truncated when using Email2Case? / Why am I not seeing all the Email content for an inbound Email2Case?
|Knowledge Article Number||000187943|
|Description||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 will appear as if the email has been truncated.|
|Resolution||By default the 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 32000 characters per field
Subject 4000 characters
(you can use workbench to view any Salesforce field size - workbench/login.php - once you login you use the Jump To Standard and Custom Objects section and find Email Message object)
If these limits are exceeded rather than bouncing the email as a failure Salesforce will truncate the ending content and store the email in the available space. Please note if you are using a forwarding rule on your email server you will still retain a copy of the full email.
Referring to the issue described earlier of inbound emails being truncated you can also use workbench to validate if this is the issue you are facing with your inbound email2case. Find the Email Message Id of record you believe to at 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 -
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, Word Pad 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 32,000 characters mark if the email is being truncated by the field size limit. If the characters are around the 32,000 character mark in either HtmlBody or TextBody and you expect additional emails of this size in the future please open a case with support and request that the Email Body field size be increased. This increase will only apply to emails submitted AFTER the increase is put in place, old records will remain truncated and you may want to re-send the emails.
When dealing with large emails, please keep in mind the following:
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.