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&#039;t know how to solve it. I have tried to use 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.CheckFinalS tatus() +683<BR>System.Net.HttpWebRequest.EndGetResponse(I AsyncResult asyncResult) +140<BR>System.Net.HttpWebRequest.GetResponse() +147<BR>WebApplication1.EmailSender.get_Html() in c:inetpubwwwrootwebapplication1emailsender.cs:67<B R>WebApplication1.EmailSender.generelMail() in c:inetpubwwwrootwebapplication1emailsender.cs:46<B R>WebApplication1.EmailSender..ctor(OdbcDataReade r emailList, Boolean htmlFormat, String dir) in c:inetpubwwwrootwebapplication1emailsender.cs:27<B R>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