Exchange Server 2007 Web Services PHP Class

后端 未结 5 1969
挽巷
挽巷 2021-02-02 04:54

Does anyone know of an open source PHP class (preferably BSD or MIT license) that will interface with the MS Exchange Server 2007 Web Services via. SOAP?

I am looking fo

5条回答
  •  死守一世寂寞
    2021-02-02 05:13

    Here is a class that you need: php-ews (This library makes Microsoft Exchange 2007 Web Services easier to implement in PHP). You could find it at: http://code.google.com/p/php-ews/

    There is only one example but that should give you the way to implement it. Below you can find an implementation in order to:

    • connect to server
    • get the calendar events

    Note: don't forget to fill-in blank variables. You would also need to include php-ews classes files (I used the __autoload PHP function).

    $host = '';
    $username = '';
    $password = '';
    $mail = '';
    $startDateEvent = ''; //ie: 2010-09-14T09:00:00
    $endDateEvent = ''; //ie: 2010-09-20T17:00:00
    
    $ews = new ExchangeWebServices($host, $username, $password);
    $request = new EWSType_FindItemType();
    $request->Traversal = EWSType_FolderQueryTraversalType::SHALLOW;
    
    $request->CalendarView->StartDate = $startDateEvent; 
    $request->CalendarView->EndDate = $endDateEvent; 
    $request->CalendarView->MaxEntriesReturned = 100;
    $request->CalendarView->MaxEntriesReturnedSpecified = true;
    $request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;
    
    $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;   
    $request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = $mail;
    $response = $ews->FindItem($request);
    echo '
    '.print_r($response, true).'
    ';

提交回复
热议问题