I have a page that uses SMTP to send mail. My host upgraded from .NET 2.0 from 1.1 and both pages of ASP code no longer work. This has to be a simple thing, but I just don't get what needs to change. Any thoughts?
Code:
<p>
<%@ Page Language="C#" %>
<%@ Import NameSpace="System.Web.Mail" %>
<script runat="server">
protected void Page_Load(Object Sender, EventArgs e) {
if(!Page.IsPostBack)
Message.Text = "";
}
protected void Send_Email(Object Sender, EventArgs e) {
MailMessage mail = new MailMessage();
mail.To = "info@sitenamegoeshere.com";
mail.From = Request.Form["from"];
mail.Subject = "Web Email Form";
mail.Body = Request.Form["body"];
SmtpMail.SmtpServer = "smtp.myisp.com";
SmtpMail.Send(mail);
Response.Flush();
Message.Text = "Message Sent...<br><br>" +
"<a href=\"contacts.aspx\">Go Back</a>";
}
</script>