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());
}

