protected void btnSubmit_Click(object sender, EventArgs e) { try { MailMessage Msg = new MailMessage(); Msg.From = txtEmail.Text; Msg.To = txtTo.Text; Msg.Subject = txtSubject.Text; Msg.Body = "Name:" + txtFrom.Text + "Department:" + drpDep.Text; SmtpMail.SmtpServer = "mail.domain.com"; SmtpMail.Send(Msg); Msg = null; //Page.RegisterStartupScript("UserMsg", "<script>alert('Mail sent thank you...');if(alert){ window.location='/ETC/';}</script>"); Response.Redirect("../Confirmation.aspx"); } catch (Exception ex) { Console.WriteLine("{0} Exception caught.", ex); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)