Hi zen1010
Unfortunately creating HTML email isn't the easiest process in the
computer world. This is primarily because the two technologies (email
and HTML) were designed for widely differing purposes and at different
times. Hence to glue the two together takes a bit of effort.
SMTP email, first formally referenced August 1982 in RFC 821:
http://www.ietf.org/rfc/rfc0821.txt
HTML 1.0, never formally proposed as a standard, but originating some
10 years after email, around 1990-91:
http://infomesh.net/html/history/early/
A good, basic introduction to HTML emails can be found at the
following WebMonkey page:
http://hotwired.lycos.com/webmonkey/98/08/index3a.html
This includes a short tutorial on how to send HTML emails using
popular web-based and standalone email clients, along with a technical
(but not TOO technical) explanation of how it all works.
However the above set of pages only teaches you how to send HTML
source via email in such a way that the receiving person's email
client will interpret it as HTML (by setting the Content-type: of the
email header to MIME-type text/html). This technique has a number of
drawbacks.
Firstly, it doesn't allow people without an HTML-aware email client to
see anything other than your HTML source code. Despite the prevalance
of modern graphical operating systems and email clients, there are
still many, many millions of people who still view email in plain-text
mode, either out of necessity, because they prefer it, or for security
reasons. Some people simply dislike HTML emails, end of story:
http://www.georgedillon.com/web/html_email_is_evil.shtml
Don't worry though, there IS a solution! However, it's more
complicated than the method mentioned at the WebMonkey site I listed
above.
What you have to do is send through multiple files within your single
email message in such a way that the following happens:
* for users with a text-only email client, their system will
automatically pick up a plain ASCII text version of your email
content.
* for users who have an HTML-aware client, their email system will not
only parse and display the HTML source code you have sent through, but
will also display the relevant images, CSS, etc that you have also
included in the mail. This is achieved using the Multipart/Alternative
and Multipart/Related MIME-types.
Some background info might be relevant here: MIME stands for
"Multipurpose Internet Mail Extensions" and is the standardised way in
which email clients pass non-textual and non-ASCII messages around,
including images, extensions to the Latin alphabet, other alphabets
and, most importantly in our case, HTML (or any other file type). For
more about MIME feel free to read
http://www.nacs.uci.edu/indiv/ehood/MIME/MIME.html
The official definition of the Multipart/Related MIME type comes from
the Internet RFC number 2112, March 1997:
http://www.faqs.org/rfcs/rfc2112.html
It explains, in some considerable technical detail, how to send
through many different files in a single email message, in such a way
that an email client will know how to put together and display the
ones it recognises. Hence a text-only email client will only recognise
the file marked up as "text/plain" and hence shows the ASCII content,
whereas an HTML-aware email client can recognise the sections marked
up as "text/html" and "image/jpeg" (for example) and put them together
as in a web page.
So we have found the method used to create HTML email! Now, how do we
apply it? Well, it all depends what you want to do. The simplest way
is to use a web browser with a built-in Email link, for example
Internet Explorer version 5 or 6. When you're at the page you want to
send you can click the File menu, and from the drop-down menu select
Send -> Page by Email. Depending on which email client you use, this
should send the file to your desired recipient.
However if you want to do something without user intervention (send a
page of latest news to subscribers once a week, say), you will be
required to do some programming. Depending on which programming
languages you have access to, you will require different tools.
For example using Perl you can make use of the MIME::Lite::HTML CPAN
module:
http://www.cpan.org/modules/by-module/MIME/MIME-Lite-HTML-1.7.readme
With PHP you could use some of the techniques listed here:
http://www.zend.com/zend/spotlight/sendmimeemailpart3.php
Or using ASP/VB you could examine some of the ideas mentioned at:
http://www.aspalliance.com/chrisg/default.asp?article=104
I hope the above gives you some information about how HTML email works
and sufficient pointers for you to be able to make use of it within
your existing website setup. If you'd like some clarification of any
of the points I've raised then please feel free to ask!
Regards
iaint-ga
Search terms:
"html email"
://www.google.co.uk/search?q=%22html%20email%22
mime multipart related
://www.google.co.uk/search?q=mime+multipart+related
perl multipart/related
://www.google.co/uk/search?q=perl+multipart%2Frelated
PHP multipart/related
://www.google.co/uk/search?q=PHP+multipart%2Frelated
VB ASP multipart/related
://www.google.co/uk/search?q=VB+ASP+multipart%2Frelated |