Fandom

HTML & CSS Wiki

HTML e-mail

649pages on
this wiki
Add New Page
Comments0 Share

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 Edit

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 mail.example.com 25
Connected to mail.example.com.
This opens a telnet session to the mail server. Replace mail.example.com with your mail server's host name.
HELO local.example.com
250 mail.example.com Hello local.example.com
[123.45.67.89], pleased to meet you.
Where local.example.com 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.
MAIL FROM: sender@example.com
250 2.5.0 Address Ok.
Here sender@example.com should be your e-mail address. Again, this is not verified.
RCPT TO: recipient@example.com
250 2.1.5 recipient@example.com OK.
Where recipient@example.com is the recipient's address.
DATA
354 Enter mail, end with a single ".".
Now we can start constructing the actual e-mail!
Cc: recipient2@example.com
Subject: This is the e-mail subject
MIME-Version: 1.0
Content-Type: text/html; charset="ISO-8859-1"

<html><body>
<h1>Hello, world!</h1>
</body></html>
.
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 (.).
QUIT
221 2.3.0 Bye received. Goodbye.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.