you can call this function as per your requirement
function:-
public bool sandMail(string strTo, string strfrom,string password,string strSubject, string strBody)
{ MailMessage mailObj=new MailMessage();
SmtpClient clientObj = new SmtpClient();
clientObj.Credentials = new System.Net.NetworkCredential(strfrom, password);
clientObj.Host = "smtp.gmail.com";
clientObj.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
clientObj.EnableSsl = false;
clientObj.Port = 587;
MailAddress mailadTo = new MailAddress(strTo);
MailAddress mailfrom = new MailAddress(strfrom, "rizwan");
mailObj.To.Add(mailadTo);
mailObj.From = mailfrom;
mailObj.Subject = "hi";
mailObj.IsBodyHtml = true;
clientObj.Send(mailObj);
return true;
}