我正在尝试将基于 php 的日历管理系统插入到 Exchange 2007 日历中。
我目前有以下代码设置。
$subject = 'Appointment with ..';
$request = new EWSType_CreateItemType();
$request->Items = new EWSType_NonEmptyArrayOfAllItemsType();
$request->Items->CalendarItem = new EWSType_CalendarItemType();
$request->Items->CalendarItem->Subject = $subject;
$date1 = new DateTime('2015-05-10T15:00:00+03:00');
$DateStart = $date1->format('Y-m-d H:i:00');
$date = new DateTime($DateStart);
$request->Items->CalendarItem->Start = $date->format('c');
$date1 = new DateTime('2015-05-10T17:00:00+03:00');
$DateEnd = $date1->format('Y-m-d H:i:00');
$date = new DateTime($DateEnd);
$request->Items->CalendarItem->End = $date->format('c');
$request->Items->CalendarItem->ReminderIsSet = false;
$request->Items->CalendarItem->ReminderMinutesBeforeStart = 15;
$request->Items->CalendarItem->Body = new EWSType_BodyType();
$request->Items->CalendarItem->Body->BodyType = EWSType_BodyTypeType::HTML;
$request->Items->CalendarItem->Body->_ = <<<EOD
<p><strong>Staff Attending</strong>:bob</p>
EOD;
$request->Items->CalendarItem->ItemClass = new EWSType_ItemClassType();
$request->Items->CalendarItem->ItemClass->_ = EWSType_ItemClassType::APPOINTMENT;
$request->Items->CalendarItem->Sensitivity = new EWSType_SensitivityChoicesType();
$request->Items->CalendarItem->Sensitivity->_ = EWSType_SensitivityChoicesType::NORMAL;
$request->Items->CalendarItem->Categories = new EWSType_ArrayOfStringsType();
$request->Items->CalendarItem->Categories->String = array(
'Client Meeting (Scheduled)'
);
$request->Items->CalendarItem->Location = "Showroom";
$request->SendMeetingInvitations = EWSType_CalendarItemCreateOrDeleteOperationType::SEND_ONLY_TO_ALL;
$request->Items->CalendarItem->RequiredAttendees->Attendee[0]->Mailbox->EmailAddress = "user@domain.com";
$request->Items->CalendarItem->RequiredAttendees->Attendee[0]->Mailbox->RoutingType = 'SMTP';
$n = 1;
$response = $ews->CreateItem($request);
这将在用户个人日历中设置一个事件就好了,但我需要做的是让它发布到我有 folderID 的公用文件夹日历。
如果有人可以提供帮助,将不胜感激!