PHP WebDAV for Microsoft Exchange Server
By
Troy on
Mar 18th, 2006 2:10 am Does your organization use Microsoft Exchange?
Do you have a need to incorporate your Exchange data with your PHP web applications?
You can use the WebDAV methods to query your Microsoft Exchange Server using the PHP scripting language. Once you wrap your brain around these techniques, the sky is the limit for developing custom Outlook-integrated web applications.
The code below only shows one example of how you can use WebDAV with Exchange. It shows how to iterate over all the subfolders in a user's inbox and display them.
The code below makes use of 2 of my most popular PHP classes:
- class_http
- class_xml
You can read more about those 2 classes and see more PHP WebDAV examples at www.troywolf.com/articles.
Very interesting script! Just about the only PHP script I've been able to find on this topic.
Im trying to write a script to access the public calendar and publish this to our intranet, but we're using Forms Based Authentication on your exchange server. This means Im not able to use this script because you have to query /exchweb/bin/auth/owaauth.dll with the username and password, save the incoming cookie and further use this to gain access to the goods. Is it possible to make a FBA compatible version of this script?
- HybridDK
HybridDK
Newbie Poster
2 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Like HybridDK I am having the same issue. It would be valuable to know how to use this script with FBA compatability.
Thank you to anyone who knows.
- Smatter.tv
smatter.tv
Newbie Poster
1 post since Jul 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Hi,
I have to extract contacts from an Exchange server over SSL authentification.
---------------------------------------------------------------------------
$exchange_server = "https://mail.justexchange.com/exchange/";
$exchange_username = "demo1@JustExchange.net";
$exchange_password = "Password1!";
---------------------------------------------------------------------------
Using this code I could not connect.
This is the error message I've got:Warning: fgets() [function.fgets]: SSL: fatal protocol error in C:\wamp\www\asterisk\class_http.php on line 127
Can someone help me PLZ?
chakermed
Newbie Poster
1 post since Oct 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
This looks like it's just what I need for my current project, but I can't get the example to work.
After modifying the connection parameters for my situation, I get the following strange error:
There is a problem with the http request:
New http() object instantiated.
--------------------------------
fetch() called
url: https://exchange.mydomain.net/Exchange/myusername/inbox
getFromUrl() called
Could not open connection. Error 0: The operation completed successfully.
I've twiddled around with this for a while, but I can't get it to work. Anyone have any clues?
greenie2600
Newbie Poster
2 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I have got the example to work... almost that is!
the only error I get now is:
Warning: Invalid argument supplied for foreach() in G:...
any suggestions?
drdal
Newbie Poster
1 post since Mar 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Hi,
I have downloaded both:
- class_http
- class_xml
I can run the script the the problem now im facing is how to retrieve the particular email property (i.e the email body text), i know the URN is
"urn:schemas:httpmail:textdescription" but i just dont know how to create a proper WebDAV query, keep having "400 Bad Request" error.
I tried using the following code to retrieve:
$h->xmlrequest = '<?xml version="1.0"?>';
$h->xmlrequest .= <<<END
<a:searchrequest xmlns:a="DAV:">
<a:sql>
SELECT "urn:schemas:httpmail:subject" FROM "$exchange_server/Exchange/vincent/inbox"
</a:sql>
</a:searchrequest>
END;
vzent
Newbie Poster
2 posts since May 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Hi
to get the subject and content of a mail you can use
SELECT "urn:schemas:httpmail:textdescription" , "urn:schemas:httpmail:subject", "urn:schemas:httpmail:datereceived" FROM "$exchange_server/pillsburylawmail/mailboxnow/Inbox/"
Sujin
sujinss
Newbie Poster
1 post since Sep 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I know someone posted the question regarding Forms Based Authentication (FBA) awhile back but it does not look like there was any conclusion. Has anyone been able to develop a version that can be implemented with FBA in place on the Exchange Server? Any assistance would be greatly appreciated.
Thanks,
Aaron
ahoffman
Newbie Poster
1 post since May 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
There seem to be a few people here with the same issue as me.
I am trying to connect to Exchange 2007 with PHP and Forms Based Authentication is on.
It's been a couple of years since some of these posts. Did anyone find a solution?
I've got several scripts that are successfully interfacing and have been for ages with an on-site Exchange 2003, but a new solution we're using is remotely hosted and set up with FBA. Any help that anyone can offer would be greatly appreciated!
Richard
rj_mayer
Newbie Poster
2 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
How can we delete the Messages from Server?
I can retrieve the message from exchange server but how can I delete those messages through script once mail retrived.
chris_dev
Newbie Poster
1 post since Dec 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
I have the SAME question, how do we delete Appointments or Email messages??? Please answer!
Best regards!
manu29
Newbie Poster
1 post since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
How can i add a calendar event to the exchange server with this code snippet?
dskanth
Newbie Poster
8 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
© 2013 DaniWeb® LLC
Page generated in 0.0945 seconds
using 2.71MB