Iterate through the parts and check their contect-type to find out.  It
could be because the message was constructed wrong.  Send me the message
if you want me to take a look.

Steve

> -----Original Message-----
> From: Jm Seigneur [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, February 06, 2003 10:29 AM
> To: 'James Users List'
> Subject: RE: PB with MimeMultipart multipart = 
> (MimeMultipart) message.getContent();
> 
> 
> So, why is the content type text/plain since there's a .jpg 
> file attached?
> 
> Thanks,
> 
> Jm
> > -----Original Message-----
> > From: Steve Short [mailto:[EMAIL PROTECTED]]
> > Sent: 06 February 2003 17:55
> > To: James Users List; [EMAIL PROTECTED]
> > Subject: RE: PB with MimeMultipart multipart = (MimeMultipart) 
> > message.getContent();
> > 
> > 
> > getContent will return a String if the content type is text/plain.
> You
> > need to check the content type before you can cast to String or 
> > Multipart.
> > 
> > Steve
> > 
> > > -----Original Message-----
> > > From: Jm Seigneur [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 06, 2003 8:09 AM
> > > To: 'James Users List'
> > > Subject: PB with MimeMultipart multipart = (MimeMultipart) 
> > > message.getContent();
> > >
> > >
> > > Hello,
> > >
> > > I've seen in the archive that it is possible to get the 
> > > MimeMultipart of a new Mail like that:
> > >
> > > MimeMultipart multipart = (MimeMultipart) 
> > > mail.getMessage().getContent();
> > >
> > > When I send an email with some binary file attached, I get a
> > > java.lang.ClassCastException: java.lang.String.
> > >
> > > The reason I'd like to get the multipart is to discard the 
> > > attachment.
> > >
> > > My question is:
> > > Why do I get this exception?
> > >
> > > Thanks,
> > >
> > > Jm
> > >
> > >
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > >
> > >
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to