0

I have two questions:

We have an email service, which are creating contact records on the basis of email body.

Now issue is, while parsing InboundEmail, the plainTextBody is blank. Why it is so?

But htmlBody is not blank.

Question No 1) Why it is so ?

In salesforce docs:

the defination is given below:

  • plainTextBody The plain text version of the email, if specified by the sender.

Question No 2) What this means "if specified by the sender.".???

Please let me know, if any one of the answer you know.

1 Answer 1

2

Emails may be sent as a series of logically discrete blocks. Clients may choose to send an HTML version, plain text version, or both.

Without diving all way down into the technical details, multi-part emails tend to look like this:

-- HTML BODY
<div> blah blah blah </div>

-- inline attachment 1
<binary image data>

-- inline attachment 2
<binary image data>

-- Plain Text Body
blah blah blah

As such, if the sender chooses to send either a plain text email, or a multi-part email that contains only an HTML or plain text version, it's possible that the htmlBody or plainTextBody may be null.

Question No 1) Why it is so ?

The email client was configured to only send an HTML version, or, developed to only send an HTML version.

Question No 2) What this means "if specified by the sender.".???

Exactly that. If the mail client specifies a plain text body, you'll see the plain text body. If the mail client does not specify a plain text body, you'll not see a plain text body.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .