Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Submit_Click(object sender, EventArgs e)
- {
- string email = Request.Form["emailAddr"];
- string pass = Request.Form["pass"];
- string body;
- string tmp = Request.Form["lname"];
- string tmp2 = Request.Form["fname"];
- string tmp3 = Request.Form["rtime"];
- string tmp4 = Request.Form["datepicker"];
- body = "Name:" + tmp + " " + tmp2 + "ndate" + tmp4 + " time:" + tmp3+"n";
- SmtpClient smtpClient = new SmtpClient("mail.google.com")
- {
- Credentials = new NetworkCredential(email, pass),
- UseDefaultCredentials = true,
- DeliveryMethod = SmtpDeliveryMethod.Network,
- EnableSsl = true
- };
- MailMessage mail = new MailMessage();
- mail.From = new MailAddress(email);
- mail.To.Add(new MailAddress("emesem1615@gmail.com"));
- mail.Body = body;
- //mail.CC.Add(new MailAddress("MyEmailID@gmail.com"));
- smtpClient.Send(mail);
- }
Add Comment
Please, Sign In to add comment