Gmail – Toggle text/plain and text/HTML in email client such as Yahoo, Gmail, or Hotmail

gmailoutlook.comyahoo-mail

I'm testing some mail sending software that I've written and I'm sending emails in text/plain format with an alternative format of text/HTML.

How do I toggle between the text/plain and text/HTML views in a web based mail client?

I'm using Yahoo, Hotmail, and Gmail for my testing so the method to toggle the views in any one of those clients will work for me.

(At the moment all the clients show me the email in text/HTML format but I want to verify that the text/plain format is good, but can't see it.)

Best Answer

In Gmail, I think your only option is to click the arrow on the top right of the message, and then choose "Show Original".

The message is most likely to be sent in MIME format, so you can scroll down past the headers and look for something like this: Content-Type: text/plain. In MIME format, there are unique strings (boundaries) between each message part, I believe that each email client chooses its own string to use. You can find out what is being used if you locate the following header:

Content-Type: multipart/alternative;
        boundary="-----------=Sample_Msg_Part156165161321654"

In this case, the string -----------=Sample_Msg_Part156165161321654 is used to delimit the different message parts.

Here's an example...

Let's say that the message has the following content:

From: user@example.com
To: user@example.com
Subject: Test
MIME-Version: 1.0
Content-Type: multipart/alternative;
        boundary="-----------=Sample_Msg_Part156165161321654"

-----------=Sample_Msg_Part156165161321654
Content-Type: text/plain

This is a sample message. This is the text portion of 
the message.
-----------=Sample_Msg_Part156165161321654
Content-Type: text/html

This is a sample message. This is the <b>html</b> portion
of the message.
-----------=Sample_Msg_Part156165161321654

... the plain text would look like this:

This is a sample message. This is the text portion of the message.

... while the HTML would look like this:

This is a sample message. This is the html portion of the message.

Related Topic