I’ve been trying to setup a web form to send mail using my google account, but I have repeatedly had no luck. I’ve found many posts about people who are having the same problems, but have yet to come across a viable solution. Here is the code, if you see something that is incorrect, please let me (and others) know how to fix it.
System.Net.Mail.MailMessage mail = new MailMessage();
mail.From = new MailAddress("firstname.lastname@example.org", "Do Not Reply");
mail.To.Add(new MailAddress("email@example.com", "My Email"));
mail.Subject = "Email Subject";
mail.Body = message;
mail.IsBodyHtml = true;
mail.Priority = MailPriority.High;
SmtpClient client = new SmtpClient();
client.EnableSsl = true;
client.Port = 587;
client.Host = "smtp.google.com";
client.UseDefaultCredentials = false;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Credentials = new System.Net.NetworkCredential("firstname.lastname@example.org", "password");
We recently upgraded a server to Windows Server 2008, and some of our old applications decided that they no longer want to work. We are now having problems with the asp:ListView object, constantly getting the error Unknown server tag ‘asp:ListView’.
I’ve found a few articles (quite a few) that all point to the web.config file, saying that you need to add these lines:
<assemblies> <add assembly="System.Web.Extensions, Version=188.8.131.52, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </controls> </pages>
The best (and only) solution for the problem Unknown server tag ‘asp:ListView’ on Windows Server 2008 is to completely uninstal the .NET Framework 3.5 and the .NET Framework 3.5 SP1. Download them from Microsoft – Do not install them through the Server Roles feature in Windows Server 2008 – and reinstall them from the installation packages.
Hope this helps!