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("");
smtpc.Port =587;
smtpc.EnableSsl = true;
smtpc.UseDefaultCredentials = false;
string user = ""; //<--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 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;

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