how to fetch messages using IMAPFolder ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chirag_patel
Posted On:   Wednesday, October 2, 2002 05:13 AM

Dear Friends,

   Anybody knows how to show messages with IMAPFolder ?

Thank u.

Chirag Patel

you can do like this

Posted By:   yh_lee  
Posted On:   Monday, October 7, 2002 08:18 PM

try
{
if(!folder.isOpen())
folder.open(1);
Message amessage[] = folder.getMessages();
FetchProfile fetchprofile = new FetchProfile();
fetchprofile.add(javax.mail.FetchProfile$Item.ENVELOPE);
fetchprofile.add(javax.mail.FetchProfile$Item.FLAGS);
folder.fetch(amessage, fetchprofile);
}
for(int i=0;i displayMessage(amessage[i]);
}
catch(MessagingException messagingexception)
{
messagingexception.printStackTrace();
}
finally
{
try
{
if(folder.isOpen())
folder.close(false);
}
catch(MessagingException mex) { }
}
About | Sitemap | Contact