Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/opt/local/bin/php
- <?
- function __autoload($className)
- {
- $className = str_replace('_','/', $className);
- $sFileName = '../vendor/php-ews/' . $className . '.php';
- if (file_exists($sFileName) && !class_exists($className))
- {
- require_once $sFileName;
- }
- // If the above if fails, you're program will terminate, there is no way to catch this.
- }
- include("../vendor/php-ews/ExchangeWebServices.php");
- $host = "ews.mex02.emailsrvr.com";
- $username = "radium_exchange@raxapp.com";
- $password = "Racker123$";
- $ews = new ExchangeWebServices($host, $username, $password);
- // start building the find folder request
- $request = new EWSType_FindFolderType();
- $request->Traversal = EWSType_FolderQueryTraversalType::SHALLOW;
- $request->FolderShape = new EWSType_FolderResponseShapeType();
- $request->FolderShape->BaseShape =
- EWSType_DefaultShapeNamesType::ALL_PROPERTIES;
- // configure the view
- $request->IndexedPageFolderView = new EWSType_IndexedPageViewType();
- $request->IndexedPageFolderView->BasePoint = 'Beginning';
- $request->IndexedPageFolderView->Offset = 0;
- // set the starting folder as the inbox
- $request->ParentFolderIds =
- new EWSType_NonEmptyArrayOfBaseFolderIdsType();
- $request->ParentFolderIds->DistinguishedFolderId =
- new EWSType_DistinguishedFolderIdType();
- $request->ParentFolderIds->DistinguishedFolderId->Id =
- EWSType_DistinguishedFolderIdNameType::INBOX;
- // make the actual call
- $response = $ews->FindFolder($request);
- echo $response;
- echo '<pre>'.print_r($response, true).'</pre>';
- ?>
Add Comment
Please, Sign In to add comment