I successfully managed to receive emails from my Exchange Inbox Folder via the EWS Java API:
Folder inbox = Folder.bind(service, WellKnownFolderName.Inbox);
FindItemsResults<Item> findResults = service.findItems(inbox.getId(),view);
for(Item item : findResults.getItems())
{
//Do something with the item as shown
System.out.println(item.getSubject());
}
However, I would like to read the emails from the Inbox of a group folder:
Comment: A Group Folder is a Exchange Folder, which many employees can access (German: Ressourcenpostfach)
But I can't find out the folder ID or how to access the inbox folder of the group folder.
Can anybody help?
You need to set the Mailbox:
ItemView iview = new ItemView(1);
Mailbox mb = new Mailbox();
mb.setAddress("[email protected]");
FolderId folderId = new FolderId(WellKnownFolderName.Inbox, mb);
FindItemsResults<Item> findResults = service.findItems(folderId, iview);