04-29-2007, 04:22 PM
Join Date: Apr 2007
Post Thanks: 0
Thanked 0 Times in 0 Posts
| | Email Attachment Read
Please Login to Remove!
I am trying to read an email attachment via the following code:
Part p = mp.getBodyPart(i);
String contentype = p.getContentType();
Object oPart = p.getContent();
oPart always returns null for UnsupportedAttachmentPart. ContentType is application/octet-stream.
I have also tried creating an inputStream which also returns null.
UnsupportedAttachmentPart uap = (UnsupportedAttachmentPart)mp.getBodyPart(i);
Object attachText = uap.getContent();
I have spent countless hours searching everywhere...couldn't find an answer to "how to read an email attachment". I would greatly appreciate it if anyone can answer my questions.