Add new comment

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Submitted by Brian (not registered) on Wed, 2009-04-29 21:39.

Yes, I'm replying to myself...

Turns out that 'inbox' (or 'Inbox') isn't one of the blessed folders that can be called by name, you have to dig for the Id and ChangeKey for 'Top of Information Store' and take a look in there to find the folder with a display name of 'Inbox'.

 <code>
$FindFolder->Traversal = 'Shallow';
$FindFolder->FolderShape->BaseShape = 'AllProperties';
$FindFolder->ParentFolderIds->DistinguishedFolderId->Id = 'root';
$result = $client->FindFolder($FindFolder);
$folders = $result->ResponseMessages->FindFolderResponseMessage->RootFolder->Folders->Folder;
foreach ($folders as $folder)
{
    if ('Top of Information Store' == $folder->DisplayName)
    {
        $tois_folder = $folder;
    }
}
$FindFolder = null;
$FindFolder->Traversal = 'Shallow';
$FindFolder->FolderShape->BaseShape = 'AllProperties';
$FindFolder->ParentFolderIds->FolderId->Id = $tois_folder->FolderId->Id;
$FindFolder->ParentFolderIds->FolderId->ChangeKey = $tois_folder->FolderId->ChangeKey;
$result = $client->FindFolder($FindFolder);
$folders = $result->ResponseMessages->FindFolderResponseMessage->RootFolder->Folders->Folder;
foreach ($folders as $folder)
{
     if ('Inbox' == $folder->DisplayName)
     {
          // $folder is now the Inbox
     }
}
</code>

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.

Reply

*
*
The content of this field is kept private and will not be shown publicly.


*

  • Images can be added to this post.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <div>
  • Lines and paragraphs break automatically.