HTML e-mail is the most popular method to format e-mail messages, and uses HTML.

While most e-mail clients support HTML e-mail, the level of support is even more diverse than among web browsers. The situation gets even more complicated by web-based e-mail clients like Gmail and Hotmail, where first the HTML e-mail source is transformed into an HTML snippet that is inserted into the HTML source of the e-mail client, and secondly the web browser (or other user agent) renders the HTML page.

Creating HTML e-mail

While most e-mail clients provide a graphical interface to create HTML e-mail, there are few that allow full control over the HTML source. One of the most direct ways is using the command-line to telnet to the mail server (the provided server replies are examples, they don't need to be exactly the same):

Command you enter Reply you should get
telnet 25
Connected to
This opens a telnet session to the mail server. Replace with your mail server's host name.
250 Hello
[], pleased to meet you.
Where is your domain name. Don't worry too much about this, the specs say that the mail server has to accept whatever you write here.
250 2.5.0 Address Ok.
Here should be your e-mail address. Again, this is not verified.
250 2.1.5 OK.
Where is the recipient's address.
354 Enter mail, end with a single ".".
Now we can start constructing the actual e-mail!
Subject: This is the e-mail subject
MIME-Version: 1.0
Content-Type: text/html; charset="ISO-8859-1"

<h1>Hello, world!</h1>
250 2.0.0 Message accepted for delivery.
All mail headers start with a keyword followed by a colon (:), the rest is the actual e-mail contents. The specs say there should be an empty line between the headers and the message. Remember to end your email with a dot (.).
221 2.3.0 Bye received. Goodbye.
Community content is available under CC-BY-SA unless otherwise noted.