Coder Social home page Coder Social logo

zboxpl / exchange-web-services-for-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rileydutton/exchange-web-services-for-php

0.0 2.0 0.0 67 KB

A basic library for interacting with Exchange Web Services using PHP 5.

License: MIT License

PHP 100.00%

exchange-web-services-for-php's Introduction

Exchange Web Services for PHP

This is a basic library that abstracts a few of common operations using the Exchange Web Services API present on Exchange Server 2007. It is based in large part on Talking SOAP with Exchange.

Right now only basic operations are supported (getting a list of all email from a user's inbox (including attachments), sending email messages, getting calendar events, and utilizing Delegate support to access multiple accounts), but as time goes on hopefully more funtionality will be added.

Installation

Basic Installation

You can give this a shot, but it doesn't work for me on my Exchange server. If it doesn't work for you, don't panic, just see the "Advanced Installation" section below.

The basic installation is basically just to tell the ExchangeClient to look on the Exchange Server itself for the SOAP files. You would do so during initialization, like so:

$exchangeclient = new ExchangeClient();
$exchangeclient->init("mailbox_username", "mailbox_password", NULL, "http://exchange.server.local/EWS/Services.wsdl");

If that works for you, great. If not, then you had the same problem as me, see the Advanced section below.

Advanced Installation

Installation is a bit more complicated than I'd like, but most of that is due to the way the API is set up.

The first thing you must do is download the SOAP files from your Exchange server. Those files are located here (be sure to replace "exchange.server.local" with the address of the Exchange server on your network):

http://exchange.server.local/EWS/Services.wsdl

http://exchange.server.local/EWS/messages.xsd

http://exchange.server.local/EWS/types.xsd

Download those three files, and place them in the same directory as the "ExchangeClient.php" file.

Finally, open up the Services.wsdl file in a TEXT EDITOR (do not use a Word Processor like MS Word), and at the very bottom of the file, before the final </wsdl:definitions> tag, add the following:

<wsdl:service name="ExchangeServices">
	<wsdl:port name="ExchangeServicePort" binding="tns:ExchangeServiceBinding">
		<soap:address location="http://exchange.server.local/EWS/Exchange.asmx"/>
	</wsdl:port>
</wsdl:service>

Be sure to replace the exchange.server.local with your actual exchange server address.

That's it! You should now be ready to use the library. Just include 'init.php' in your PHP script, and you're off.

Example

The following code initializes the library and sends off a quick test messsage:

include "init.php";

$ec = new ExchangeClient();
$ec->init("mailbox_username", "mailbox_password");
$ec->send_message("[email protected]", "Subject", "A test message");

License

This project is licensed under the MIT License. See the included LICENSE files for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.