dcsimg
How do you find imap folder names?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Josh_Mangelson
Posted On:   Thursday, January 3, 2008 01:46 AM

I'm using JavaMail to access gmail's IMAP server, how do I find out what the folders on their server are named and their organization. I can read emails in the INBOX but, how do I find the other folder names.

Re: How do you find imap folder names?

Posted By:   Anonymous  
Posted On:   Wednesday, March 12, 2008 06:31 AM

This gives you all folders:


Store store = session.getStore( "imaps" );
store.connect();

Folder defaultFolder = store.getDefaultFolder();

Folder[] f = defaultFolder.list();
for ( Folder folder : f )
{
System.out.println( folder.getFullName() );
}


Kind regards, Christian
About | Sitemap | Contact