5

我手头有一项任务,需要我连接 Exchange Online 帐户并在 PHP 中列出所有日历条目。

我已经阅读了许多 Microsoft 帮助文档,但都是指 c# 代码。有人可以指导我完成使用 PHP 实现这一目标的步骤。

4

1 回答 1

14

尝试这个:

$ews = new ExchangeWebServices($host, $username, $password);

$request = new EWSType_FindItemType();
$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;

$request->ItemShape = new EWSType_ItemResponseShapeType();
$request->ItemShape->BaseShape =
        EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;

$request->CalendarView = new EWSType_CalendarViewType();
$request->CalendarView->StartDate = date('c', strtotime('01/01/2011 -00'));
$request->CalendarView->EndDate = date('c', strtotime('01/31/2011 -00'));

$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId =
        new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id =
        EWSType_DistinguishedFolderIdNameType::CALENDAR;

有了这个:https ://github.com/jamesiarmes/php-ews

于 2013-02-18T14:14:34.480 回答