Multipart Alternative Email
An email containing HTML is usually sent by email providers or readers as multipart/alternative by default.
This means that there will be two versions of your email sent to the recipient - one in plain text format and another one in HTML. The reason being that your recipient may have turned on plain text viewing only in their email reader. If they have not, then the HTML version will be delivered to them.
This process usually happens behind the scenes, so you may not even know what your email client is doing. We have provided an example below so that you can understand it better.
In the following screenshot, using Thunderbird, we are sending a multipart/alternative email:
Let's take a look at the message source which tells us how exactly it was sent:
When the message was received by the recipient, this is how it looked like when the email reader was setup to accept HTML by default.
We decided to display the messages in Plain Text only (which is what some recipients may prefer) and this is how the message looked like:
Notice that the last two lines are not displayed in red anymore.
Why would somebody decide to view messages in plain text only? - you may ask.
That's because HTML may contain hidden stuff - like viruses, tracking programs etc. making it unsafe for your computer. Although a lot of improvements have been made in delivering emails containing HTML safer, but at the same time, spammers have also come up with new techniques to overcome the safety barriers.