I am trying to get the list of emails by Message msg[] = folder.getMessages();
. After that I am getting the details of each message, meanwhile I am getting javax.mail.MessagingException: Failed to load IMAP envelope
exception for some message.
This is protocol trace for the one message which producing error -
A7 FETCH 2 (ENVELOPE INTERNALDATE RFC822.SIZE)
* 2 FETCH (RFC822.SIZE 2567 INTERNALDATE "29-Apr-2011 13:49:01 +0000" ENVELOPE ("Fri, 29 Apr 2011 19:19:01 +0530" "I NEES YOUR ASSISANCE?????" (("Mr Leung Cheung" NIL "info" "milium.com.br")) (("Mr Leung Cheung" NIL "info" "milium.com.br")) ((NIL NIL "mr.leung_cheung" "live.hk")) () NIL NIL NIL "<20110429134718.70333732030A@mail2.milium.com.br>"))
A7 OK FETCH Completed
Stacktrace of error is-
Failed to load IMAP envelope stacktrace: javax.mail.MessagingException: Failed to load IMAP envelope
at com.sun.mail.imap.IMAPMessage.loadEnvelope(IMAPMessage.java:1276)
at com.sun.mail.imap.IMAPMessage.getSentDate(IMAPMessage.java:377)
at com.my.main.model.TestMail.showAllMails(TestMail.java:95)
at com.my.main.model.TestMail.main(TestMail.java:45)
I am using JavaMail-1.5.
How can I resolve this error, is there any way or settings to solve it and get details of message without skipping that message?
Thanks,
Neelam Sharma