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]>