PHPackages                             rklandesverband/php-ews - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rklandesverband/php-ews

ActiveLibrary

rklandesverband/php-ews
=======================

v0.10.7(5y ago)022BSD-3-ClausePHP

Since Jul 3Pushed 5y agoCompare

[ Source](https://github.com/RoteskreuzNoe/php-ews)[ Packagist](https://packagist.org/packages/rklandesverband/php-ews)[ RSS](/packages/rklandesverband-php-ews/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (62)Used By (0)

PHP Exchange Web Services
=========================

[](#php-exchange-web-services)

[![Build Status](https://camo.githubusercontent.com/80c3ef80f3efc7b534710b1bd6cd666089516ae8aca951fcd2d707a2595ed963/68747470733a2f2f7472617669732d63692e6f72672f476172657468702f7068702d6577732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Garethp/php-ews)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0dff01cb68920ef805fd6535055a23c7e4ce62cbc88a75542b75b327817f4726/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676172657468702f7068702d6577732f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/garethp/php-ews/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/02142251f577d4257daf072d356ab523c74fbe273c14814b3c13bfc6391b8bb5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676172657468702f7068702d6577732f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/garethp/php-ews/?branch=master)

The PHP Exchange Web Services library (php-ews) is intended to make communication with Microsoft Exchange servers using Exchange Web Services easier. It handles the NTLM authentication required to use the SOAP services and provides an object-oriented interface to the complex types required to form a request.

Dependencies
============

[](#dependencies)

- PHP 5.5+
- cURL with NTLM support (7.23.0+ recommended)
- Composer
- Exchange 2007 or 2010\*

\**Note: Not all operations or request elements are supported on Exchange 2007.*

Installation
============

[](#installation)

Require the composer package and use away

```
composer require garethp/php-ews

```

Usage
=====

[](#usage)

The library can be used to make several different request types. In order to make a request, you need to instantiate a new `API` object:

```
$ews = API::fromUsernameAndPassword($server, $username, $password, $options = array());
```

The `API::fromUsernameAndPassword` static constructor takes four parameters:

- `$server`: The url to the exchange server you wish to connect to, without the protocol. Example: mail.example.com.
- `$username`: The user to connect to the server with. This is usually the local portion of the users email address. Example: "user" if the email address is "".
- `$password`: The user's plain-text password.
- `$options`: (optional): A group of options to be passed in
- `$options['version']`: The version of the Exchange sever to connect to. Valid values can be found at `ExchangeWebServices::VERSION_*`. Defaults to Exchange 2010.
- `$options['timezone']`: A timezone to use for operations. This isn't a PHP Timezone, but a Timezone ID as defined by Exchange. Sorry, I don't have a list for them yet
- `$options['httpClient']`: If you want to inject your own GuzzleClient for the requests
- `$options['httpPlayback']`: See the Testing Section

Once you have your `API` object, you need to build your request object. The type of object depends on the operation you are calling. If you are using an IDE with code completion it should be able to help you determine the correct classes to use using the provided docblocks.

The request objects are build similar to the XML body of the request. See the resources section below for more information on building the requests.

Simple Library Usage
====================

[](#simple-library-usage)

There's work in progress to simplify some operations so that you don't have to create the requests yourself. Examples are located [here](examples/) to browse in small snippets. If you have more examples you want to add, just make a PR for it. If you would like to request an example, file a Github issue, and I'll try to create it if I know how

Manual Usage
============

[](#manual-usage)

While simple library usage is the way to go for what it covers, it doesn't cover everything, in fact it covers rather little. If you want to do anything outside of it's scope, go ahead and use `API::getClient()` as a generic SOAP client, and refer to the Microsoft documentation on how to build your requests. Here's an example

```
$api = API::withUsernameAndPassword($server, $username, $password);

$start = new DateTime('8:00 AM');
$end = new DateTime('9:00 AM');

$request = array(
    'Items' => array(
        'CalendarItem' => array(
            'Start' => $start->format('c'),
            'End' => $end->format('c'),
            'Body' => array(
                'BodyType' => Enumeration\BodyTypeType::HTML,
                '_value' => 'This is the body'
            ),
            'ItemClass' => Enumeration\ItemClassType::APPOINTMENT,
            'Sensitivity' => Enumeration\SensitivityChoicesType::NORMAL,
            'Categories' => array('Testing', 'php-ews'),
            'Importance' => Enumeration\ImportanceChoicesType::NORMAL
        )
    ),
    'SendMeetingInvitations' => Enumeration\CalendarItemCreateOrDeleteOperationType::SEND_TO_NONE
);

$request = Type::buildFromArray($request);
$response = $api->getClient()->CreateItem($request);
```

Testing
=======

[](#testing)

Testing is done simply, and easy, wit the use of my own HttpPlayback functionality. The HttpPlayback functionality is basically a built in History and MockResponses Middleware for Guzzle. With a flick of an option, you can either run all API calls "live" (Without interference), "record" (Live, but saves all the responses in a file) or "playback" (Use the record file for responses, never hitting the exchange server). This way you can write your tests with the intention to hit live, record the responses, then use those easily. You can even have different phpunit.xml files to switch between them, like this library does. Here's some examples of running the different modes:

```
$client = API::withUsernameAndPassword(
    'server',
    'user',
    'password',
    [
        'httpPlayback' => [
            'mode' => 'record',
            'recordLocation' => __ROOT__ . DS . '/recordings.json'
        ]
    ]
);

//Do some API calls here
```

That will then record al lthe responses to the recordings.json file. Likewise, to play back

```
$client = API::withUsernameAndPassword(
    'server',
    'user',
    'password',
    [
        'httpPlayback' => [
            'mode' => 'playback',
            'recordLocation' => __ROOT__ . DS . '/recordings.json'
        ]
    ]
);

//Do some API calls here
```

And then those calls will play back from the recorded files, allowing you to continuously test all of your logic fully without touching the live server, while still allowing you to double check that it really works before release by changing the mode option.

Versioning
==========

[](#versioning)

The versioning of this component is done to comply with [semver](http://semver.org/) standards. This means that any BC breaks that are made will result in an increasing Major Version number (IE: 1.x -&gt; 2.x), and new features that do not result in BC breaks will result in Minor version increases (IE: 1.1.x -&gt; 1.2.0) and bug fixes that do not result in new features or BC breaks will result in the Patch number increasing (IE: 1.0.0 -&gt; 1.0.1). The exception is development pre-1.0 release, where the Minor number is treated as a Major and the patch number is treated as both Patch and Minor numbers. That means that you can pin your composer to, say, 0.6.\* and you will not receive any BC breaks, as BC breaks will result in the Minor version changing.

Resources
=========

[](#resources)

- [Exchange 2007 Web Services Reference](http://msdn.microsoft.com/library/bb204119(v=EXCHG.80).aspx)
- [Exchange 2010 Web Services Reference](http://msdn.microsoft.com/library/bb204119(v=exchg.140).aspx)

Support
=======

[](#support)

All questions should use the [issue queue](https://github.com/garethp/php-ews/issues). This allows the community to contribute to and benefit from questions or issues you may have. Any support requests sent to my email address will be directed here.

Contributions
=============

[](#contributions)

Contributions are always welcome!

### Contributing Code

[](#contributing-code)

If you would like to contribute code please fork the repository on [github](https://github.com/garethp/php-ews) and issue a pull request against the master branch. It is recommended that you make any changes to your fork in a separate branch that you would then use for the pull request. If you would like to receive credit for your contribution outside of git, please add your name and email address (optional) to the CONTRIBUTORS.txt file. All contributions should follow the [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) and [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standards. If you're interested in a list of things that still needs to be done, check out the [TODO.md](TODO.md) file

### Contributing Documentation

[](#contributing-documentation)

If you would like to contribute to the documentation, make a PR against this repository with documentation as examples in the [examples/](examples/) folder. I request that you do not make changes to the home page but other pages (including new ones) are fair game. Please leave a descriptive log message for any changes that you make.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 73.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~0 days

Total

61

Last Release

1927d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1077a78acff712c42d676e23d7de47295dad65d66ed967c9ff2aca96fa328b8b?d=identicon)[rklvnoe](/maintainers/rklvnoe)

---

Top Contributors

[![Garethp](https://avatars.githubusercontent.com/u/709912?v=4)](https://github.com/Garethp "Garethp (427 commits)")[![jamesiarmes](https://avatars.githubusercontent.com/u/1030345?v=4)](https://github.com/jamesiarmes "jamesiarmes (124 commits)")[![ambulanceracer01](https://avatars.githubusercontent.com/u/19904947?v=4)](https://github.com/ambulanceracer01 "ambulanceracer01 (8 commits)")[![daareiza](https://avatars.githubusercontent.com/u/8284557?v=4)](https://github.com/daareiza "daareiza (3 commits)")[![cby016](https://avatars.githubusercontent.com/u/1350113?v=4)](https://github.com/cby016 "cby016 (3 commits)")[![didilem](https://avatars.githubusercontent.com/u/11373755?v=4)](https://github.com/didilem "didilem (2 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (1 commits)")[![fglueck](https://avatars.githubusercontent.com/u/3225774?v=4)](https://github.com/fglueck "fglueck (1 commits)")[![koab](https://avatars.githubusercontent.com/u/4482306?v=4)](https://github.com/koab "koab (1 commits)")[![LuthorDevelopment](https://avatars.githubusercontent.com/u/10698011?v=4)](https://github.com/LuthorDevelopment "LuthorDevelopment (1 commits)")[![MoT3rror](https://avatars.githubusercontent.com/u/5009981?v=4)](https://github.com/MoT3rror "MoT3rror (1 commits)")[![nvanheuverzwijn](https://avatars.githubusercontent.com/u/943226?v=4)](https://github.com/nvanheuverzwijn "nvanheuverzwijn (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![tekuonline](https://avatars.githubusercontent.com/u/10102943?v=4)](https://github.com/tekuonline "tekuonline (1 commits)")[![thisispiers](https://avatars.githubusercontent.com/u/1831251?v=4)](https://github.com/thisispiers "thisispiers (1 commits)")[![eldiddio](https://avatars.githubusercontent.com/u/1051389?v=4)](https://github.com/eldiddio "eldiddio (1 commits)")[![errakhaoui](https://avatars.githubusercontent.com/u/3143905?v=4)](https://github.com/errakhaoui "errakhaoui (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rklandesverband-php-ews/health.svg)

```
[![Health](https://phpackages.com/badges/rklandesverband-php-ews/health.svg)](https://phpackages.com/packages/rklandesverband-php-ews)
```

###  Alternatives

[garethp/php-ews

A PHP Library to interact with the Exchange SOAP service

113610.3k4](/packages/garethp-php-ews)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
