How do I send mail with both plain text as well as HTML text so that each mail reader(Client) can choose the format appropriate for it?
I tried following code. but the output was in a mixed format - no html formattting. Also, it was displaying the headers and boundary string.
Any Idea what went wrong?
or could you give me some example using javax.mail?

 Session session = Session.getInstance( new Properties (),
                                        null );
 Transport trans = session.getTransport("smtp");
 MimeMultipart content = new MimeMultipart("alternative");
 MimeBodyPart htmlBody = new MimeBodyPart();
 MimeBodyPart textBody = new MimeBodyPart();
 String txtmessage = "this is a text based message" +
                     "is being sent\n\tbye";
                    "text/plain; charset=\"iso-8859-1\"" );

                     "text/html; charset=\"iso-8859-1\"" );

  MimeMessage msg = new MimeMessage(session);
  msg.setFrom(new InternetAddress(from));
  msg.setContent( content );
  msg.setHeader("Content-Transfer-Encoding", "7bit");
  msg.setSentDate(new Date());
  trans.connect (host, "", "");
  trans.sendMessage( msg, InternetAddress.parse( to ))