<pre lang="C#">MailMessage Msg = new MailMessage();
Msg.From = new MailAddress(mail id here);
Msg.To.Add(mail id);
Msg.Subject = "Add Subject";
Msg.Body = "Hi, <br/><br/>Detailss<br/><br/>: """;
Msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.Credentials = new System.Net.NetworkCredential("from Mail id here","passwordhere");
smtp.EnableSsl = true;
smtp.Send(Msg);
ScriptManager.RegisterStartupScript(Page, GetType(), "MyScript", "alert('Your Password Details Sent to your mail');", true);
"e");
;</pre>