Send Mail
add-using System.Net.Mail;
--------------------------------------------------------------------------------------------------------------------------
MailMessage mail = new MailMessage();//object created
//Setting From , To and CC
mail.To.Add(Textboxemail.Text);
mail.From = new MailAddress("from@gmail.com");
mail.Subject = "thanks for Registartion";
mail.Body = "Thanks for registration in test. Your Password is " + ":" + " " + Labelpass.Text;
mail.IsBodyHtml = true;// it will convert msg format in html
//smtp object
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Credentials = new System.Net.NetworkCredential("email", "password");//email id & password
smtp.EnableSsl = true;// server security licence will true then only mail will send
smtp.Send(mail);
--------------------------------------------------------------------------------------------------------------------------
MailMessage mail = new MailMessage();//object created
//Setting From , To and CC
mail.To.Add(Textboxemail.Text);
mail.From = new MailAddress("from@gmail.com");
mail.Subject = "thanks for Registartion";
mail.Body = "Thanks for registration in test. Your Password is " + ":" + " " + Labelpass.Text;
mail.IsBodyHtml = true;// it will convert msg format in html
//smtp object
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Credentials = new System.Net.NetworkCredential("email", "password");//email id & password
smtp.EnableSsl = true;// server security licence will true then only mail will send
smtp.Send(mail);