Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Missing start boundary Exception when reading messages with an attachment f

843834Jan 15 2010 — edited Jan 15 2010
Hi,

I don't know why I'm getting the following exception while reading a mail with an attachment file(or even without it) from mail server
Exception in thread "main" javax.mail.MessagingException: Missing start boundary

        at javax.mail.internet.MimeMultipart.parsebm<MimeMultipart.java:872)
        at javax.mail.internet.MimeMultipart.parse<MimeMultipart.java:493)
        at javax.mail.internet.MimeMultipart.getCount<MimeMultipart.java:240)
        at GetParts.handleMultipart(GetParts.java:57)
        at GetParts.main(GetParts.java:42)
The code which causing the above exception:
  public static void handleMultipart(Multipart multipart) 
      throws MessagingException, IOException {
      
    for (int i=0, n=multipart.getCount(); i<n; i++) {//this part causing the error
      handlePart(multipart.getBodyPart(i));
    }
  }
  ) 
The content type header is looking like:
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_28171097.1262761649031"
Could anyone please tell me how can I end that exception?

Edited by: Hunky322 on 15 Jan, 2010 9:14 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2010
Added on Jan 15 2010
9 comments
5,000 views