dcsimg
JavaMail please help
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Arti_Gupta
Posted On:   Wednesday, April 17, 2002 02:57 AM

this is the segment of code i am using to read the attachments in a mulipart/mixed message Message m = fldr.getMessage(msgnum); Multipart mp = (Multipart)m.getContent(); Part part = mp.getBodyPart(partNum); String sct = part.getContentType(); if (sct==null) { out.println("invalid part"); return; } ContentType ct = new ContentType(sct); res.setContentType(ct.getBaseType()); InputStream is = part.getInputStream(); int i; while ((i=is.read())!= -1) out.write(i); My problem is that it w   More>>

this is the segment of code i am using to read the attachments in a mulipart/mixed message

			
Message m = fldr.getMessage(msgnum);


Multipart mp = (Multipart)m.getContent();


Part part = mp.getBodyPart(partNum);


String sct = part.getContentType();


if (sct==null)

{

out.println("invalid part");

return;

}


ContentType ct = new ContentType(sct);


res.setContentType(ct.getBaseType());


InputStream is = part.getInputStream();

int i;


while ((i=is.read())!= -1)

out.write(i);




My problem is that it works well for text/plain attachment but for the rest it does not decode them... Please suggest what to do?
thanking you in anticipation    <<Less

Re: JavaMail please help

Posted By:   John_Zukowski  
Posted On:   Saturday, April 20, 2002 01:27 PM

Dealing with attachments/multiparts is already covered in the FAQ.
About | Sitemap | Contact