我正在使用https://github.com/jamesiarmes/php-ews进行Exchange Web服务,而且我在添加帐户联系人时遇到问题。
当我使用我的模拟详情登录时:
$ews = new ExchangeWebServices($this->server_address, $this->server_username, $this->server_password);
我想创建一个新联系人,例如:
$request = new EWSType_CreateItemType();
$contact = new EWSType_ContactItemType();
$contact->Initials = $this->relation->initials;
$contact->GivenName = $this->relation->first_name;
$contact->MiddleName = $this->relation->insertion;
$contact->Surname = $this->relation->last_name;
$request->Items->Contact[] = $contact;
$result = $ews->CreateItem($request);
我想将此联系人添加到我的模拟帐户列表中的帐户。
我希望避免像以下交换用户一样直接登录:
$ews = new ExchangeWebServices($this->server_address, 'some@outlook.account', 'somepassword');
这可能吗?我怎么会做到这样的事情?谢谢你的阅读!
答案 0 :(得分:1)
我建议你最远离詹姆斯的php-ews,它没有维护,也没有关注任何PSR。我建议你看看我自己的前叉garethp/php-ews
。创建一个联系人会非常相似,但是我的分支(示例here)很容易模仿,如果这对你不起作用,你总是可以给我一个Github问题,我就可以了试着帮忙