We are sending an automated email with mail's body in HTML format and we are receiving the email content twice in the body.Once with this header
X-Mailer: Microsoft Outlook 16.0
This is a multipart message in MIME format.
"BASE64" / "QUOTED-PRINTABLE" / "8BIT" / "7BIT" / "BINARY" / "x-token"
Is Content-Transfer-Encoding an HTML header?
No, it is not related to HTML or to to be exact "just HTML". "
Content-Transfer-Encoding" is the header of the particular content of the MIME (it may be HTML content as well) which indicate encoding of this content when added to MIME to transfer this content. I know it sounds a bit weird, content, content and content, but may be this resource would help you to understand better: Content-Transfer-Encoding Header Field. The
Content-Transfer-Encoding is designed to specify an invertible mapping between the "native" representation of a type of data and a representation that can be readily exchanged using 7 bit mail transport protocols. But enough theory, lets do some real world example you have ...
You compose your message with Outlook in HTML format. When message will leave Exchange environment (sent out) it will be converted to MIME to travel through Internet. At this point your HTML will be encoded with appropriate, to the content of this HTML, type and
Content-Transfer-Encoding header will be added to this content, so the recipient of this message able to convert this content back to original HTML by decoding the content. I hope this clear now.
We are sending a mail in html format and we are receiving the mail content twice in the body.
According to rfc2046 for Multipurpose Internet Mail Extensions (MIME) Alternative Subtypes of the same body (your HTML content) were created at the time message was converted into MIME and appropreate header was added to indicate that "
Content-Type: multipart/alternative;". Each of the body parts is an "alternative" version of the same information. This means you have "
text/plain" content, which represent nothing else as strip off version of your HTML to bare text. This content is alternative to HTML and has it's own
Content-Transfer-Encoding header based on the content. This content may be used by the recipients who do not have ability to render HTML.