Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Shared Folder JavaMail and Imap  RSS feed

 
J, Mench
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just wondering if anyone knows how to access a shared folder using store.getfolder() or something else.
Thanks
 
manoj bagul
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
This might help u .

Folder mailFolder = mailStore.getFolder("INBOX") ;
mailFolder.open(Folder.READ_ONLY);
Message mailMessage[] = mailFolder.getMessages() ;
int totalMailCountInt = mailFolder.getMessageCount() ;
// get the message details
FetchProfile mailFetchProfile = new FetchProfile() ;
mailFetchProfile.add(FetchProfile.Item.ENVELOPE);
mailFetchProfile.add("X-mailer");
mailFolder.fetch(mailMessage,mailFetchProfile);
// get the message details
for(int colInt=0;colInt<totalMailCountInt;colInt++)
{
// process the message mailMessage[]
// u can get all details check the java mail documentation.
}

Manoj
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!