I am trying to create a send html functionality in a windows UI
application. And using c# (of course) and the System.Web.Mail objects
some sites work (aka www.microsoft.com) and some sites do not work
(www.slickdeals.net) is there a reason? what would cause this to
happen. I took the code that looks something like this..
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "yo*@yourcompany.com";
mail.Subject = "this is a test email.";
string url = "http://www.microsoft.com";
mail.Body = HttpContent( url );
mail.BodyFormat = MailFormat.Html;
mail.UrlContentBase = url;
SmtpMail.SmtpServer = "localhost"; //your real server goes here
SmtpMail.Send( mail );
And the error I get is
System.Web.HttpException: Could not access 'CDO.Message' object. --->
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80040212): The transport
lost its connection to the server.
Any thoughts?