I'm using PHP-EWS (https://github.com/jamesiarmes/php-ews) inside a cakePHP application. The goal is to read E-Mails from a "Public Folder" from the exchange server.
The Problem is I can only read the first "Dimension" of public folders and can't find a way to get the subdirectorys.
The folder I have to read from is 4 levels deep.
$this->connect();
// start building the find folder request
$request = new FindFolderType();
$request->Traversal = FolderQueryTraversalType::SHALLOW;
$request->FolderShape = new FolderResponseShapeType();
$request->FolderShape->BaseShape = DefaultShapeNamesType::ALL_PROPERTIES;
// configure the view
$request->IndexedPageFolderView = new IndexedPageViewType();
$request->IndexedPageFolderView->BasePoint = 'Beginning';
$request->IndexedPageFolderView->Offset = 0;
// set the starting folder
$request->ParentFolderIds = new NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = DistinguishedFolderIdNameType::PUBLIC_FOLDERS_ROOT;
// request
$response = $this->ews->FindFolder($request);
If I change "Traversal" to DEEP I get the error .
DEEP TRAVERSAL queries are not allowed for public folders.
I also tried to change
$request->IndexedPageFolderView->BasePoint
To things like "end" "second", it didn't change anything so I could not figure out what it does and how to use it.
I can't get the subdirectory Folder id (for changing the start point) either because it gets never selected.
Thank you for your help.