File Under: HTML

Send HTML-Formatted E-mail

A wedding of linkable web pages and regular e-mail, HTML e-mail is a growing medium for Internet communications, and it’s getting easier to use.

HTML e-mail brings the power of the web browser to your e-mail inbox. Maybe you receive daily newsletters, weather updates, gardening tips, or whatever with pictures, fancy text and backgrounds and clickable links? That’s HTML e-mail. All the information and delivery ease of an e-mail but with the look and feel of a web pages.

With a basic knowledge of web design and a touch of e-mail savvy, you, too, can offer your own content in this format.


Contents

  1. What you’ll need
  2. Limitations
    1. How It Works
  3. Final Analysis

What you’ll need

It may seem like a needless step, but take a moment to be sure that your e-mail service supports all of the standard mail protocols like POP (Post Office Protocol), IMAP (Internet Mail Access Protocol), SMTP (Simple Mail Transfer Protocol), and MIME (Multipurpose Internet Mail Extensions). Free accounts are available from Hotmail and Gmail among others, should you need one.


Limitations

Before taking the plunge, beware of the challenges of any e-mail endeavor:list management, bounced mail, and angry subscribers. And if you think designing for multiple browsers is fun, you will love HTML e-mail agents that ignore your tags. Let’s spend a moment dwelling on the technology’s limitations.

It’s not good practice to include frames or exceedingly large images in HTML e-mails. Page anchors and custom backgrounds are usually supported. You will need to use absolute links, since the user will view your page within a foreign domain. (Relative links can be converted to absolute links using a simple search-and-replace.)

Also, some mail agents skip the bgcolor attribute in the <body> tag. One trick is to specify bgcolor in a <td> (table cell) and put your whole page within the one-cell table.

Don’t forget the folks who accidentally receive your HTML e-mail through a standard ASCII-text mail agent. If you’re not careful, your audience will be looking at all your mark-up mess (the raw links might work, but the page won’t look pretty). For this crowd, insert a comment tag — so it won’t appear when it shouldn’t — with some friendly unsubscribe instructions. In my opinion, friendly unsubscribe instructions should be included as a basic courtesy on any e-mail sent to a subscriber list.


How It Works

Here’s how it works. Incoming mail is stored in your POP account on an internet server as multipart MIME documents. A message is divided into a text component and MIME file attachments. These attachments are associated with a URL that calls in the graphics, animations and other elements at viewing time.

Outgoing HTML e-mail is sent like any other piece of internet mail using SMTP — the trick is to manipulate the header information that accompanies your message.

In addition to To:, From:, Cc:, and Bcc:, an e-mail header specifies content type, transfer encoding, and display properties of the mail. The most important of these header fields for HTML e-mail is Content-Type. Most mail agents send mail with Content-Type:text/plain, but you want yours to read Content-Type:text/html. Most mail agents will not let you modify this field, so you have to be crafty. One solution is to compose your HTML e-mail manually using a Unix mailer program. This will enable you to type a customized header. Here’s an example of a test message with appropriate header information:

Errors:errors@YourDomain.com

From:Your Name <you@YourDomain.com>

To:Recipient Name <them@Theirs.com>

Subject:test message

MIME-Version:1.0

Content-Type:text/html; charset=us-ascii

Content-Transfer-Encoding:7bit

Content-Disposition:inline; filename="filename.html"

Content-Base:http://www.YourDomain.com



<b>Hello there.</b><br>

Monkey see, monkey do.

Notice the extra line break before the body of the message. In a Unix mailer program, the body begins with the line following two consecutive carriage returns and ends with a single period on its own line. To test your message, send it to yourself.

 % sendmail -t filename.html

The -t tells your Unix mailer to read the header information from the file itself.

Congratulations! Now you can send HTML e-mail from a Unix prompt. It felt really great the first time I sent myself an HTML e-mail. I admit my enthusiasm has diminished over time.

On the bright side, the tools have long since caught up. Most clients, including Microsoft Outlook and Mozilla Thunderbird can send and receive HTML e-mail. Most web-based e-mail programs can even default to “Content-Type:text/html” with a button-click.

Now it’s time to set up an HTML e-mail offering on your own site. Just remember to take an occassional weekend to yourself. At least whistle while you work.

Final Analysis

HTML e-mail will not change your life. It’s a communications gimmick, a remora clinging to the belly of the internet. Spun from the success of web-based e-mail, HTML e-mail brings designer layouts, graphics, animation, sound and interactivity to the genre. What’s more — it caters to laziness. The not-so-savvy web enthusiast can passively receive updated content from a growing list of web publishers. In commercial corridors, HTML e-mail is used to ping an ambivalent user base while providing useful information in a sexy format. It’s non-invasive push media. This fosters habit-forming behavior in the user and encourages clickthroughs to a site.

In all fairness, my biggest gripe with HTML e-mail is download time. It’s e-mail at the speed of a web page, and it will make you wait. There’s some appeal to downloading personalized daily news while you’re brushing your teeth, but is it worth it? Be your own guide.