sir i used the following code but it is giving this error...
The remote certificate is invalid according to the validation procedure.
using (MailMessage mm = new MailMessage("subhamkhaitan90@gmail.com", TextBox4.Text))
{
string n = TextBox1.Text;
mm.Subject = "successful registration";
mm.Body = "Thankyou " + n +" for registering with mOVieS nOw.Your unique username is "+user+" . Please use the above username for login purpose in future. ";
mm.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential("subhamkhaitan90@gmail.com", "GANESHJI1");
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Email sent.');", true);
}