MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com", 587);
mail.From = new MailAddress("from@xyz.com");
mail.To.Add("to@asd.com");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess;
SmtpServer.Credentials = new System.Net.NetworkCredential("userid", "pwd");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com", 587);
mail.From = new MailAddress("from@xyz.com");
mail.To.Add("to@asd.com");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess;
SmtpServer.Credentials = new System.Net.NetworkCredential("userid", "pwd");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);