Click here to Skip to main content
15,072,735 members

Comments by Member 11497495 (Top 1 by date)

Member 11497495 20-Mar-15 3:17am View
   
// Send Regisration number to user's mail box after submitting the form successfully
SmtpClient smtpc = new SmtpClient("smtp.gmail.com");
smtpc.Port =587;
smtpc.EnableSsl = true;
smtpc.UseDefaultCredentials = false;
string user = "sirikondaswapna@gmail.com"; //<--Enter your gmail id here
string pass = "swapnashankar19";//<--Enter Your gmail password here
string sub = "Form filling Application:"; //Subject for your website
string msg = "Webcome to http://msdotnet.co.in Your Registration Number is: " + Label2.Text; //Message body
smtpc.Credentials = new NetworkCredential(user, pass);
MailMessage email = new MailMessage(user, TextBox6.Text, sub, msg);
email.IsBodyHtml = true;
smtpc.Send(email);

Label1.Text = "Your form has been submitted successfully.Take Preview Now,Your Registration Number is: ";
Label3.Text = null;