Greetings esolm,
Sending HTML email is actually a fairly simple process. Getting that email to look good in most of the common email clients and viewers is another matter. First, let's start with the email itself. All you really need to send HTML email is a multi-part text email. To do this, just add a "Content-Type" reference in the header, then seperate the sections of the email with boundaries. Here's a very stripped down header example:
Date: Fri, 13 Apr 2001 12:58:21 -0700
From: Gryphon Shafer <gryphon@gryphonshafer.com>
Subject: HTML Email
Content-Type: multipart/alternative;
boundary="------------FE45F2D4BB7695EE89FC118F"
Then wrap your message body with the boundary that you defined. (BTW, the boundary title/alias itself is just a bunch random numbers and letters. I heard somewhere that it should be different for each email you send, but I'm not sure that's valid.) Here's a brief example of the email message body:
--------------FE45F2D4BB7695EE89FC118F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
This is some text with a bolded word.
This is a second line with an italicized word.
--------------FE45F2D4BB7695EE89FC118F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
This is some text with a <b>bolded</b> word.
<br>This is a second line with an <i>italicized</i> word.</html>
--------------FE45F2D4BB7695EE89FC118F--
OK, so that gets you into the sending of the HTML email itself. As far as correct viewing on clients, that's another story. With regard to AOL, don't even bother with HTML other than adding links to full URLs. Anything else may not work between both the online email reading and client reading for AOL users. Netscape and Outlook users will be able to view just about any HTML email you send them. Avoid using background images, though, since they are almost always stupid. HotMail gets really upset when you split tags across lines. For example:
<A
href="something.html">text</A>
This is perfectly reasonable HTML code, but it often doesn't work for HotMail users. The carriage return messes something up. So put all tags on a single line. Carriage returns outside of tags are fine, however. Also, add a few extra carriage returns at the end of both the text and HTML versions of the email since some clients mess up the end of the email when such CRs are not there.
Good luck.
-gryphon. |