using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Net; using System.Net.Mail; public partial class Contact1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ButtonSend_Click(object sender, EventArgs e) { // Sending e-mail using SmtpClient and yahoo try { SmtpClient clientemail = new SmtpClient("smtp.yahoo.com", 587); clientemail.EnableSsl = true; MailAddress from = new MailAddress(TextBoxEmail.Text, TextBoxname.Text); MailAddress to = new MailAddress("topmoviesfree@yahoo.com", "Top Movies"); MailMessage message = new MailMessage(from, to); message.Body = TextBoxbody.Text; message.Subject = "User Request"; clientemail.Send(message); Errormessage.Text = "The Contract Details was sent Successfully"; } catch (Exception) { Errormessage.Text = "Sorry, There is an error please try again"; } } }