See RFC 2046 section 5.1.4. In the case of multipart/alternative, each part represents the same content, listed in INCREASING order of preference (fidelity to the original). The first one would be the least common denominator.
All of the various RFCs for Internet E-mail are collected at http://www.imc.org/rfcs.html. A useful starting point for MIME e-mail, if you don't want to wade through the former is http://www.oac.uci.edu/indiv/ehood/MIME/MIME.html. --- Noel -----Original Message----- From: Hung Phan [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 14:46 To: James Users List Subject: RE: Got java.lang.ClassCastException: javax.mail.internet.MimeMultipart Hi Noel, I've looked at the mailet. For multipart/alternative type, I've have something like ... MimeMultipart multipart = (MimeMultipart) message.getContent(); for(int i=0; i<multipart.getCount(); i++) { MimeBodyPart part = (MimeBodyPart) multipart.getBodyPart(i); body += part.getContent().toString(); } is it safe to assume when i=0, it refers to the body of an email? I've tried to received emails sent from MS outlook with HTML format, and it looks so. Because I just want to retrieve the body of an email only. Thanks, --Hung -----Original Message----- From: Noel J. Bergman [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 4:54 PM To: James Users List Subject: RE: Got java.lang.ClassCastException: javax.mail.internet.MimeMultipart Look at the sample mailets. For example, AddFooter. --- Noel -----Original Message----- From: Hung Phan [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 19:34 To: [EMAIL PROTECTED] Subject: Got java.lang.ClassCastException: javax.mail.internet.MimeMultipart Hello all, >From the API, MimeMessage.getContent(): Return the content as a Java object. The type of this object is dependent on the content itself. For example, the native format of a "text/plain" content is usually a String object. The native format for a "multipart" message is always a Multipart subclass. For content types that are unknown to the DataHandler system, an input stream is returned as the content. How do I handle the format for a "multipart" message? I can't find a Multipart subclass somewhere. Thanks, --Hung -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
