I'm trying to get unread mails from Exchange Server 2007 by below code. When I execute the below code, I'm getting
The remote server returned an error: (440) Login Timeout. in the below higlighted line. Am I passing any thing wrong here? As tis is critical, can anyone throw a light on this?
System.Net.HttpWebRequest loRequest;
System.Net.HttpWebResponse loResponse;
System.Net.CredentialCache loCredentials;
string lsRootUri;
byte[] laBytes;
System.IO.Stream loRequestStream;
System.IO.Stream loResponseStream;
System.Xml.XmlDocument loXmlDoc;
lsRootUri = "https://webmail.companyname.com";
string lsQuery; lsQuery = ("" + ("" + ("SELECT \"urn:schemas:httpmail:hasattachment\", \"DAV:displayname\", \"urn:schemas:httpmail:from\", \"" + "urn:schemas:httpmail:subject\", \"urn:schemas:httpmail:htmldescription\" FROM \"" + (lsRootUri + ("\"" + ("
WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = false AND \"urn:schemas:httpmail:hasattachment\" = t" + "rue" + (" AND \"urn:schemas:httpmail:read\" = false" + "")))))));
loCredentials = new System.Net.CredentialCache();
loCredentials.Add(new System.Uri(lsRootUri), "NTLM", new System.Net.NetworkCredential([username], [password] [domain]));
bala.vanchi
Member
12 Points
12 Posts
Getting Error : The remote server returned an error: (440) Login Timeout.
May 02, 2011 01:34 PM|LINK
I'm trying to get unread mails from Exchange Server 2007 by below code. When I execute the below code, I'm getting The remote server returned an error: (440) Login Timeout. in the below higlighted line. Am I passing any thing wrong here? As tis is critical, can anyone throw a light on this?
System.Net.HttpWebRequest loRequest;
System.Net.HttpWebResponse loResponse;
System.Net.CredentialCache loCredentials;
string lsRootUri;
byte[] laBytes;
System.IO.Stream loRequestStream;
System.IO.Stream loResponseStream;
System.Xml.XmlDocument loXmlDoc;
lsRootUri = "https://webmail.companyname.com";
string lsQuery; lsQuery = ("" + ("" + ("SELECT \"urn:schemas:httpmail:hasattachment\", \"DAV:displayname\", \"urn:schemas:httpmail:from\", \"" + "urn:schemas:httpmail:subject\", \"urn:schemas:httpmail:htmldescription\" FROM \"" + (lsRootUri + ("\"" + (" WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = false AND \"urn:schemas:httpmail:hasattachment\" = t" + "rue" + (" AND \"urn:schemas:httpmail:read\" = false" + "")))))));
loCredentials = new System.Net.CredentialCache();
loCredentials.Add(new System.Uri(lsRootUri), "NTLM", new System.Net.NetworkCredential([username], [password] [domain]));
loRequest = ((System.Net.HttpWebRequest)(System.Net.WebRequest.Create(lsRootUri)));
loRequest.Credentials = loCredentials;
loRequest.Method = "SEARCH";
laBytes = System.Text.Encoding.UTF8.GetBytes(lsQuery);
loRequest.ContentLength = laBytes.Length;
loRequestStream = loRequest.GetRequestStream();
loRequestStream.Write(laBytes, 0, laBytes.Length);
loRequestStream.Close();
loRequest.ContentType = "text/xml";
loRequest.Headers.Add("Translate", "F");
loResponse = ((System.Net.HttpWebResponse)(loRequest.GetResponse()));
loResponseStream = loResponse.GetResponseStream();
loXmlDoc = new System.Xml.XmlDocument(); loXmlDoc.Load(loResponseStream);
loXmlDoc.Save("c:\temp2.xml"); loResponseStream.Close();
James1980
Member
2 Points
1 Post
Re: Getting Error : The remote server returned an error: (440) Login Timeout.
May 06, 2011 06:07 AM|LINK
Had same problem and found component with FBA support.
Check this article: http://www.independentsoft.com/webdavex/tutorial/formsbasedauthentication.html
- James
bala.vanchi
Member
12 Points
12 Posts
Re: Getting Error : The remote server returned an error: (440) Login Timeout.
May 10, 2011 01:17 PM|LINK
Hi James,
Thanks for your reply. I don't want to use the third party components to access my Exchange 2007 server.
Thanks
-bala