WebDav VBscript logon is not working

G

Guest

Hello,
I am trying to get a connection to our exchange 2003 server.
I am using the script from this page:
http://www.msexchange.org/articles/Access-Exchange-2000-2003-Mailbox-WebDAV.html
but I am not be able to read any mail from the exchange server yet.
I guess the problem has to do with the authorisation. But i tried to add
userID & password on several places in the code and still get a 440 - Login
Timeout error.


<script language='VBScript'>
Dim objXMLHTTP, objXMLDoc
' Define your protocol; http or https
strProtocol = "http"
' Define your server name
strServername = "tktserver"
' Define your local name for 'Inbox'
strInbox = "Inbox"
' User name of the sender.
'strUserName = "domein\username"
' Password of the sender.
'strPassWord = "password"

Sub getMessages_OnClick()
' strUsername = document.all.mailbox.value
' If strUsername <> "" Then
strInboxURL = strProtocol & "://" & strServername & "/Exchange/"
strInboxURL = strInboxURL & strUsername & "/" & strInbox
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "search", strInboxURL, True,"username","password"
objXMLHTTP.setRequestHeader "Content-type:", "text/xml"
objXMLHTTP.setRequestHeader "Depth", "1"
objXMLHTTP.onReadyStateChange = getRef("checkXMLHTTPState")
strXML = "<?xml version='1.0' ?>" & _
"<a:searchrequest xmlns:a='DAV:'><a:sql>" & _
"SELECT" & _
" ""DAV:href""" & _
",""urn:schemas:httpmail:subject""" & _
" FROM scope('shallow traversal of """ & strInboxURL & """')" & _
" WHERE ""DAV:ishidden""=False" & _
" AND ""DAV:isfolder""=False" & _
"</a:sql></a:searchrequest>"
objXMLHTTP.SetRequestHeader "Range", "rows=0-9"
objXMLHTTP.Send(strXML)
'End If
End Sub

Username, domain & password are filled in correctly in my script.
Can somebody can tell me what i am doing wrong?
Thanks in advanced!
Greets
Sebastian
 
Top