Incoming emails (sys_email) have body and body_text populated from the incoming messages


Incoming emails (sys_email) have body and body_text populated from the incoming messages


Incoming messages have a body and body text. This information is extracted from the email messages itself. 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 contains what we expect, sometimes is difficult to track.


You would like to review the source of the body and body text when

  • The HTML body is not showing as expected
  • The body text contains HTML tags
  • The body text does not contains returns (enter) or breaks.

Incoming emails are proceed as follow

Contains HTMLContains plain text
Typical content-typeResults
YesYesmultipart/mixedbody and body_text are taken from the incoming email
YesNotext/htmlbody is taken from incoming email.
body_text is auto-generated
NoYestext/plainbody_text is taken from the incoming email.
body is auto-generated. There is a comment on the html that indicates it was auto-generated.
NoNomultipart/mixedInconclusive. Some emails could contain both body and body_text blank.



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.

content type
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 relay 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.