You can create 2 email bodies.
One with mime-type "text/html" and the other to "text/plain".
(one with all HTML, and the other message with HTML tags removed.)
Set the content-type for the email message to multipart/alternative.
The users email application should choose the appropriate form that it
supports.

There are a bunch of discussions on this topic in the javamail archives.
Here:
 http://archives.java.sun.com/archives/javamail-interest.html

Hope this helps..





                    Steven Salaets
                    <Steven.Salaets@ADVAL       To:     [EMAIL PROTECTED]
                    VAS.BE>                     cc:
                    Sent by: "A mailing         Subject:     sending email (html/text)
                    list for discussion
                    about Sun
                    Microsystem's Java
                    Servlet API
                    Technology."
                    <SERVLET-INTEREST@JAV
                    A.SUN.COM>


                    01/28/2002 09:09 AM
                    Please respond to
                    Steven Salaets






Hi everyone,

Currently I'm working on a small application in java servlets which allows
you to enter some information on a webpage (in a form) and a servlet is
processing this information in order to send it out as an email.

The email is HTML encoded (as this is a requirement) but since a lot of
people do not allow HTML based email I need to find a trick to give those
people (that do not allow HTML) something readable as well (probably plain
text?)

How can I deal with this? How can I detect the user his email configuration
in order to know that he allows HTML or not? Is there some kind of trick to
send both (html and text) in one email and based on the configuration of
the client it will show html or text?


Thanks in Advance!
Steven

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to