Created
July 13, 2010 02:38
-
-
Save datapimp/473379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = "[email protected]"; | |
$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>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment