cfmailpart order for HTML display in Gmail

It seems that Gmail only renders the HTML part of my multi-part messages from cfmail when the text cfmailpart is before the html cfmailpart.

For example, Gmail will render the text version if I do this:

<cfmail from="#from#" to="#to#" subject="Multi-part, html first">
<cfmailpart type="html"><h1>HTML Message Part</h1></cfmailpart>
<cfmailpart type="text">Text Message Part</cfmailpart>
</cfmail>

But if I just swap the order of the cfmailpart entries, then Gmail renders the HTML version:

<cfmail from="#from#" to="#to#" subject="Multi-part, text first">
<cfmailpart type="text">Text Message Part</cfmailpart>
<cfmailpart type="html"><h1>HTML Message Part</h1></cfmailpart>
</cfmail>

I had a friend test on Outlook and that client appears to show the HTML part, regardless of the ordering of the text/html parts in the message body. Though I haven't tested any other mail clients yet, I'll keep the text part first and html part second in my multi-part e-mails. I know they'll display as intended in both Gmail and Microsoft Outlook (and I'm guessing most other clients behave like Outlook, in that they'll default to an HTML part if one is there).

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.002. Contact Blog Owner