import emails from webserver

N

Nick C

Hi

I am trying to import emails from a webserver. This code retrieves only 1
email. I also would like to save them into an xml file?

thanks N

Request =
(System.Net.HttpWebRequest)HttpWebRequest.Create("http://email-server/Exchange/account/Inbox/EmailSubject.EML");
Request.Credentials = CredentialCache.DefaultCredentials;
Request.Method = "GET";
Request.Headers.Add("Translate", "f");
Response = (HttpWebResponse)Request.GetResponse();
ResponseStream = Response.GetResponseStream();
sr = new StreamReader(ResponseStream, Encoding.UTF8);
s = sr.ReadToEnd();
Console.WriteLine(s);
 
A

Alexey Smirnov

Hi

I am trying to import emails from a webserver. This code retrieves only 1
email. I also would like to save them into an xml file?

thanks N

Request =
(System.Net.HttpWebRequest)HttpWebRequest.Create("http://email-server/Exchange/account/Inbox/EmailSubject.EML");
Request.Credentials = CredentialCache.DefaultCredentials;
Request.Method = "GET";
Request.Headers.Add("Translate", "f");
Response = (HttpWebResponse)Request.GetResponse();
ResponseStream = Response.GetResponseStream();
sr = new StreamReader(ResponseStream, Encoding.UTF8);
s = sr.ReadToEnd();
Console.WriteLine(s);

The url to get all emails has to be without particular subject

http://email-server/Exchange/account/Inbox/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top