Exchange Server 2007 Web 服务 PHP 类

发布于 2024-07-13 00:58:50 字数 132 浏览 4 评论 0原文

有谁知道一个开源 PHP 类(最好是 BSD 或 MIT 许可证),它将通过以下方式与 MS Exchange Server 2007 Web 服务交互。 肥皂?

我正在寻找一个具有发送消息功能的更高级别的类。 网络服务。

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 for a higher level class that has functionality for sending messages via. the web service.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

苦妄 2024-07-20 00:58:50

我遇到了同样的问题,所以我开始在这里构建一些东西:

https://github .com/rileydutton/Exchange-Web-Services-for-PHP

它还没有做太多事情(基本上只是让您从服务器获取电子邮件列表,并发送电子邮件),但它会很好足以用作做一些更复杂的事情的基本起点。

我已经抽象出了使用 php-ews 需要费力解决的大部分复杂性。 如果您想在服务器上执行一些原始的、强大的命令,我会使用 php-ews...这适用于那些恰好使用 Exchange 服务器并想要一种简单的方法来执行一些基本任务的人。

哦,它是麻省理工学院许可的。

希望有人觉得它有用!

I had this same problem, so I started building something, here:

https://github.com/rileydutton/Exchange-Web-Services-for-PHP

It doesn't do much yet (basically just lets you get a list of email messages from the server, and send email), but it would be good enough to use as a basic starting point for doing some more complicated things.

I have abstracted out a good bit of the complexity that you would have to slog through using php-ews. If you are looking to do some raw, powerful commands with the server, I would use php-ews...this is for folks who just happen to be working with an Exchange server and want an easy way to do some basic tasks.

Oh, and it is MIT licensed.

Hope that someone finds it useful!

櫻之舞 2024-07-20 00:58:50

这是您需要的一个类:php-ews(该库使 Microsoft Exchange 2007 Web 服务更容易在 PHP 中实现)。
您可以在以下位置找到它:http://code.google.com/p/php-ews/

虽然只有一个示例,但应该可以为您提供实现它的方法。
您可以在下面找到一个实现:

  • 连接到服务器
  • 获取日历事件

注意:不要忘记填写空白变量。 您还需要包含 php-ews 类文件(我使用了 __autoload PHP 函数)。

$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 '<pre>'.print_r($response, true).'</pre>';

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 '<pre>'.print_r($response, true).'</pre>';
不弃不离 2024-07-20 00:58:50

Exchange 服务器支持 WebDAV:

http://www.troywolf.com/articles/php/exchange_webdav_examples .php

如果您只想发送消息,则可以使用 SMTP:

https://www.php.net/manual/en/book.mail.php

Exchange server supports WebDAV:

http://www.troywolf.com/articles/php/exchange_webdav_examples.php

If all you want to do is send messages, you could just use SMTP:

https://www.php.net/manual/en/book.mail.php

新人笑 2024-07-20 00:58:50

I have been researching this same issue and I have yet to find a class specific to MS Exchange. However, if you feel up to learning and building the XML yourself, you may want to have a look at the NTLM SOAP classes at http://rabaix.net/en/articles/2008/03/13/using-soap-php-with-ntlm-authentication. This will allow you to authenticate against Active Directory to make your SOAP calls, which native PHP SOAP does not allow you to do. Another decent resource that uses the same method to connect to MS CRM is http://www.reutone.com/heb/articles_internet.php?instance_id=62&actions=show&id=521.

甜心 2024-07-20 00:58:50

The examples under http://www.troywolf.com/articles/php/exchange_webdav_examples.php are for Exchange 2003 not 2007.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文