Google Answers Logo
View Question
 
Q: Embedding web pages inside email messages ( Answered,   0 Comments )
Question  
Subject: Embedding web pages inside email messages
Category: Computers > Internet
Asked by: zen1010-ga
List Price: $10.00
Posted: 13 Aug 2002 00:06 PDT
Expires: 12 Sep 2002 00:06 PDT
Question ID: 53939
I get email from commercial stes like Apple and a web page opens up in
the text field of the email, with all graphics displayed. How is this
done? I would like to do something like this with my own home page.

Request for Question Clarification by secret901-ga on 13 Aug 2002 00:17 PDT
Are you referring to the HTML content of email messages?

Clarification of Question by zen1010-ga on 13 Aug 2002 00:51 PDT
Yes, I am referring to the HTML content. I have tried pasting source
codes of an entire front page in my email messages. The graphics show
up as broken links.

Request for Question Clarification by iaint-ga on 13 Aug 2002 01:03 PDT
Do you want to create HTML messages "by hand" in your email program
(if so, which email client software will you be using)? Or are you
looking for a programmable solution that will let you automatically
create HTML emails, in which case which programming language(s) will
you be using, so that I can point you to appropriate tools or
libraries.

Clarification of Question by zen1010-ga on 13 Aug 2002 01:32 PDT
Unfortunately I am not a programmer so I don't hand code. I used a
WYSIWYG editor to create my web pages but I do understand HTML a
little bit.  I just want someone to tell me how to create HTML emails
and have the graphics display correctly, knowing very little about
programming languages.
Answer  
Subject: Re: Embedding web pages inside email messages
Answered By: iaint-ga on 13 Aug 2002 02:58 PDT
 
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
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy