我正在尝试使用 php-ews 和以下代码在 Exchange 中添加联系人:
$request = new EWSType_CreateItemType();
$request->SendMeetingInvitations = 'SendToNone';
$contact = new EWSType_ContactItemType();
$contact->GivenName = $updates['name'];
$contact->Surname = $updates['surname'];
if($updates['email'] != ""){
$email = new EWSType_EmailAddressDictionaryEntryType();
$email->Key = new EWSType_EmailAddressKeyType();
$email->Key->_ = EWSType_EmailAddressKeyType::EMAIL_ADDRESS_1;
$email->_ = $updates['email'];
// set the email
$contact->EmailAddresses = new EWSType_EmailAddressDictionaryType();
$contact->EmailAddresses->Entry[] = $email;
}
$contact->CompanyName = $updates['companyname'];
$contact->JobTitle = $updates['jobtitle'];
$contact->Birthday = $updates['birthday'];
$request->Items->Contact[] = $contact;
$response = $this->ews->CreateItem($request);
其中 $updates 是我作为参数的字符串数组。(我跳过了包含,告诉我你是否需要它们。)
现在,联系人已创建,一切正常,但生日活动并未在我的日历中自动创建。
所以,我想知道是否有一种简单的方法可以完成这项工作,除了手动创建它的明显(非优雅)方式。
提前谢谢你,里卡多