PHP code example of noname007 / yii2-ews

1. Go to this page and download the library: Download noname007/yii2-ews library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

noname007 / yii2-ews example snippets


....

   component => [
        ...
        'ews' => [
            'class' => Ews::class,
            'host' => 'exchange serve domain',
            'password' => 'service application account',
            'username' => 'service application account',
        ]
   ]

...
..

$ews = Yii::$app->ews;

$ews->impersonateByPrimarySmtpAddress('impersonated people email');

$guests =[
    new Guests(
        array('name' => 'John', 'email' => '[email protected]',)
    ),
];

$ews->createAppointment(new DateTime("@".(time() + 15 * 60)),
    new DateTime('@'.(time() + 30 * 60)),
    'subject text',
    $guests
);

shell
php composer.phar