Hello<BR><BR>I need to make some code which download a webpage, and send it as an html email. So I created a property which should get the webpage when I needed it.<BR>The problem is that I get what for me look like a strange error.<BR><BR>The error:<BR>Exception Details: System.Net.WebException: The underlying connection was closed: The remote name could not be resolved.<BR><BR>Here is the code I use, it may need to be rewriten but the problem is the error. I really don't know how to solve it. I have tried to use 127.0.0.1 and my normal ip on my network too. All help is appriciated.<BR>And if anybody knows some other way to do this using the cbl without using thirdparty tools, that would also be great.<BR><BR>public string Html {<BR> get {<BR>// Create the request object<BR>WebRequest req = WebRequest.Create("http://localhost/" + dir +"/Email.html");<BR><BR>string s;<BR><BR>try {<BR><BR>WebResponse resp = req.GetResponse(); // the error comes in this line<BR>Stream stream = resp.GetResponseStream();<BR>StreamReader sr = new StreamReader(stream);<BR><BR>s = sr.ReadToEnd();<BR>}<BR>catch(Exception e)<BR>{<BR>s = e.Message;<BR><BR>}<BR><BR><BR>return(s);<BR>}<BR>}<BR><BR><BR>The stack trace:<BR>WebException: The underlying connection was closed: The remote name could not be resolved.<BR>System.Net.HttpWebRequest.CheckFinalStatus() +683<BR>System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult) +140<BR>System.Net.HttpWebRequest.GetResponse() +147<BR>WebApplication1.EmailSender.get_Html() in c:inetpubwwwrootwebapplication1emailsender.cs:67<BR>WebApplication1.EmailSender.generelMail() in c:inetpubwwwrootwebapplication1emailsender.cs:46<BR>WebApplication1.EmailSender..ctor(OdbcDataReader emailList, Boolean htmlFormat, String dir) in c:inetpubwwwrootwebapplication1emailsender.cs:27<BR>WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootwebapplication1webform1.aspx.cs:30<BR>System.Web.UI.Control.OnLoad(EventArgs e) +67<BR>System.Web.UI.Control.LoadRecursive() +29<BR>System.Web.UI.Page.ProcessRequestMain() +724