在使用此类时,如何使用 PHP 获取用户交换邮箱中的所有未读邮件?
我想首先列出这样的文件夹内容:
$ews = new ExchangeWebServices("mailserver.domain.local", "user", "pass");
$request = new EWSType_FindFolderType();
$request->FolderShape = new EWSType_FolderResponseShapeType();
$request->FolderShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;
$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::INBOX;
$request->Traversal = new EWSType_FolderQueryTraversalType();
$result = $ews->FindFolder($request);
var_dump($result);
只有这样我才得到这个错误:
Catchable fatal error: Object of class EWSType_FolderQueryTraversalType could not be converted to string
有没有人有这门课的经验可以告诉我我做错了什么?
我知道必须传递一个字符串,但该类似乎只有 3 个常量,没有任何函数或其他属性。