Issue
Incoming messages have a body and body text. This information is extracted from the email messages themselves. However, if either the HTML or the text part is not available, that part of the message is auto-populated. When the message body or body text does not contain what we expect, sometimes is difficult to track.
Symptoms:- The HTML body is not showing as expected
- The body text contains HTML tags
- The body text does not contain returns (enter) or breaks.
Cause
Incoming emails are proceeding as follows:
Contains HTML |
Contains plain text |
Typical content-type |
Results |
Yes |
Yes |
multipart/mixed |
body and body_text are taken from the incoming email |
Yes |
No |
text/html |
body is taken from incoming email. |
No |
Yes |
text/plain |
body_text is taken from the incoming email. |
No |
No |
multipart/mixed |
Inconclusive. Some emails could contain both body and body_text blank. |
Resolution
To validate the source of the email body and body_text, check the email headers or the content-type set.
e.g. If the content-type is text/plain, the email body_text will be populated from the email itself, but the body (body_html) part will be auto-generated.
Note: Pay special attention to the email content-type. It indicates whether the body or/and body_text was auto-generated or retrieved from the email. |
I am afraid most solutions rely on getting the clients to sent the content type correctly, or the data sent correctly. Alternatively, you should be able to workaround the incorrect data on either body or body_text using scripting.