Best way to access Exchange using PHP?

2019-01-08 08:40发布

I'm writing a CMS application in PHP and one of the requirements is that it must be able to interface with the customer's Exchange server. I've written up this functionality a few times before and have always used WebDAV to do it, but now I'm leaning away from that.

I will be running the site on IIS OR Apache (no preference) on Windows server 2008. A few things I would need to do include adding contacts to a given user's address book, sending emails as a given user and running reports on contacts for a user.

All of this is pretty easy to do with WebDAV, but if there is a better way that doesn't require any functionality that is likely to be deprecated any time soon.

Any ideas?

Update:

Justin, I love the idea of using com objects, I just worry about maintaining a 3rd product to make everything work...

John, I can write a web service in C# to interface with for these functions and access it with my PHP app, but it's also a little bit out of the way.

So far, I'm not 100% convinced that either of these is better than WebDAV...

Can anyone show me where I'm being silly?

9条回答
叼着烟拽天下
2楼-- · 2019-01-08 09:11

I have released an open-source MIT licensed library that allows you to do some basic operations in PHP using Exchange Web Services.

Exchange Web Services for PHP

I have only tested it on Linux but I don't see any reason why it wouldn't work on a Windows installation of PHP as well.

查看更多
Melony?
3楼-- · 2019-01-08 09:12

I'm not a PHP dev but Google says that PHP 5+ can instantiate COM components. If you can install Outlook on a box you could write a PHP web service around the COM component to handle the requests you need.

$outlook = COM("Outlook.Application")

Outlook API referance

查看更多
男人必须洒脱
4楼-- · 2019-01-08 09:20

I would look into IMAP

IMAP, POP3 and NNTP

查看更多
登录 后发表回答