Discussions

General J2EE: MessagingException in javamail api

  1. MessagingException in javamail api (1 messages)

    We are developing a email client application using JavaMail API 1.3EA on JDK1.4.
    We were thrown javax.mail.MessagingException with the description--'Unable to load the bodystructure' in IMAPMessage.java(1092) when we are trying to call getContent() or for that matter any method on the message which has a email message attached to it as part of its body(MIME-message/rfc822) .
    But the message seems to be fine,since we tested reading the message from other mail implementations using perl.
     
    Any ideas??
     
    Thanks
  2. Hi,
        Before u retrieve the mail, Check the MIME Content of the mail, then use appropriate else if conditions to send the control.
    Example..
    if(message.isMimeType("text/plain"))
    {//plain text message
       messagearray.add(message.getContent());
    }
    else if(message.isMimeType("text/html"))
    {//Html text message
      messagearray.add(message.getContent());
    }

    Like this u can include many more conditions,

    Hope this solves ur problem..

    JAwad