public static void sendMailGmail(string from, string to, string subject, string text, string password) { MailMessage mail = new MailMessage(from, to, subject, text); SmtpClient client = new SmtpClient("smtp.gmail.com"); client.Port = 587; client.EnableSsl = true; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential(from, password); try { client.Send(mail); MessageBox.Show("Mesage has benn sant""); } catch (Exception ex) { MessageBox.Show("Failure while sending message""); MessageBox.Show(ex.Message); } } So, where I am making a mistake ?
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)