SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
System.Net.NetworkCredential credentials =
new System.Net.NetworkCredential("EmailID@gmail.com", "Password");
client.UseDefaultCredentials = false;
client.Credentials = credentials;
MailMessage msg = new MailMessage();
msg.From = new MailAddress("EmailID@gmail.com");
msg.To.Add(new MailAddress(SendToEmailId@yahoo.com));
msg.Body = "<html><body>This is a testTest test</body></html>";
msg.Subject = "Testing";
msg.IsBodyHtml = true;
client.Send(msg);