Read MS Exchange "Public Folders"

Hi

I need to read a MS exchange public folder

The structure looks like this in out look

'Public Folders'

'All Public Folders'

'Development'

'Unsubscribe'

I have tried the code below I can see the 'Public Folders' but it returns nothing in the list. I also can't get to the 'Unsubscribe' folder either. Does any one have some code for me to look at that goes multi folders down and reads the emails in the sub folder

Your help would be greatly appreciated

Thanks

Properties props = new Properties();

Session session = Session.getDefaultInstance(props, null);

Store store = session.getStore("imap");

store.connect("server", "user", "password");

Folder publicFolder = store.getFolder("Public Folders/");

Folder[] folders = publicFolder.list();

for (int i=0; i < folders.length; i++) {

System.out.println(folders.getName());

}

[971 byte] By [poisonelvesa] at [2007-11-26 18:35:08]
# 1

A few suggestions...

Try the name without the trailing slash ("/"). It shouldn't make a difference,

but it might.

Try the folderlist.java demo program. It will list everything your server knows

about, starting with the "default folder".

Try using the Store.getSharedNamespaces() method and recurse from there

using the list method.

bshannona at 2007-7-9 6:09:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...