public static function fromEmailAddress($emailAddress)
 {
     $impersonation = new self();
     $connectingSID = new ConnectingSIDType();
     $connectingSID->setPrimarySmtpAddress($emailAddress);
     $impersonation->setConnectingSID($connectingSID);
     return $impersonation;
 }
Example #2
0
<?php

use garethp\ews\API\Type\ConnectingSIDType;
use garethp\ews\API\Type\ExchangeImpersonation;
//Impersonate an email address
$api = \garethp\ews\API::withUsernameAndPassword('server', 'username', 'password', ['impersonation' => '*****@*****.**']);
//Build your own impersonation
$connectingSID = new ConnectingSIDType();
$connectingSID->setPrincipalName('Some Name');
$connectingSID->setPrimarySmtpAddress('*****@*****.**');
$impersonation = new ExchangeImpersonation();
$impersonation->setConnectingSID($connectingSID);
$api = \garethp\ews\API::withUsernameAndPassword('server', 'username', 'password', ['impersonation' => $impersonation]);