Question

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: enter image description here

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?

Était-ce utile?

La solution

You need to set the Mailbox:

ItemView iview = new ItemView(1);
Mailbox mb = new Mailbox();
mb.setAddress("mymailbox@mycompany.com");   
FolderId folderId = new FolderId(WellKnownFolderName.Inbox, mb);
FindItemsResults<Item> findResults = service.findItems(folderId, iview);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top