title: Exchange Server Error: The remote server returned an error: (440) Login Timeout
body: <p>I'm creating a window based program to retrieve emails in Exchange Server 2003 using webDAV.</p>
  
  <p>im getting the error on <code>loResponse = (HttpWebResponse)loRequest.GetResponse();</code></p>
  
  <p>Here's the code:</p>
  
  <pre><code>                lsRootUri = p_strServer + "/Exchange//" + p_strAlias + "//" + p_strInboxURL + "//";
  
  
              lsQuery = "&lt;?xml version=\"1.0\"?&gt;"
                          + "&lt;D:searchrequest xmlns:D = \"DAV:\" xmlns:m=\"urn:schemas:httpmail:\"&gt;"
                          + "&lt;D:sql&gt;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\" = true "
                          + "AND \"urn:schemas:httpmail:read\" = false"
                          + "&lt;/D:sql&gt;&lt;/D:searchrequest&gt;";
              loRequest = (HttpWebRequest)WebRequest.Create(lsRootUri);
              loRequest.Credentials = new NetworkCredential(p_strUserName, p_strPassword);
              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 = (HttpWebResponse)loRequest.GetResponse();
              loResponseStream = loResponse.GetResponseStream();
              loXmlDoc.Load(loResponseStream);
              loResponseStream.Close();
  </code></pre>