//Code for sending a welcome mail for the registered user
var smtp = new System.Net.Mail.SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.EnableSsl = true;
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.Credentials = new NetworkCredential("fromaddress@gmail.com","password");
smtp.Timeout = 20000;
smtp.Send("fromaddress@gmail.com", "toaddress@gmail.com", "Test Mail", "Hi, This is Test Mail");