[thelist] HTML EMAIL

Matthew Blanchard blanchardmatthew at hotmail.com
Fri Dec 7 06:14:38 CST 2001


> From: "Adrian Fischer" <adrian at aussiebidder.com>
> Subject: RE: [thelist] HTML EMAIL
>

> Ok...got the HTML email thing working a treat.  Next question would be
> though, if a mail client cant view html or html is turned off, how can I
> ensure they get something that makes sense instead of all my mark up?

You need to send a "multipart/alternative" message. Either find a module
that does this for you (search CPAN), or study the MIME specifications (go
to an RFC index (e.g. http://www.faqs.org/rfcs/) and search for "MIME").

In short, a "multipart/alternative" message looks like:

From: $from
To: $to
Subject: $subject
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----$UNIQUE_STRING"

This is a multi-part message in MIME format.

------$UNIQUE_STRING
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

plain text version

------$UNIQUE_STRING
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<i>html version</i>

------$UNIQUE_STRING--

You can send yourself such a message (using your favorite email client) and
then check the source (in OE: File / Properties / Details / Message Source).





More information about the thelist mailing list