为模仿账户添加联系人

问题描述:

我为Exchange Web Services使用https://github.com/jamesiarmes/php-ews,并且在为帐户添加联系人时遇到问题。为模仿账户添加联系人

当我登录使用我的模拟细节:

$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); 

我要添加此联系人的存在于我的模拟一个帐户帐户清单。

我想避免直接登录在像Exchange用户:

$ews = new ExchangeWebServices($this->server_address, '[email protected]', 'somepassword'); 

这可能吗?我将如何实现这样的事情?谢谢阅读!

我建议你离詹姆斯的php-ews最远,它没有维护,也没有遵循任何PSR。我建议你看看我自己的叉子,garethp/php-ews。创建联系人会非常相似,但通过我的叉子(如here)可以轻松实现模拟,如果这不适合您,您可以随时给我发一个Github问题,我会尽力帮助您

+0

我一定会检查出! –