Hello everyone, I recently wrote a send to netframework 4.5, everything worked ok, but now I needed 3.0, for some reason, the error SMTP exception on the last line, can anyone write on framework 3.0, tell me pliz.
MailAddress to = new MailAddress ("lala@mail.ru"); MailAddress from = new MailAddress("lololo@gmail.com"); MailMessage mail = new MailMessage(from, to); mail.Subject = "效袝效袝效袝效袝效袝效"; mail.Body = "袥袗袥袗袥袗袥袗袥袗袥"; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.Credentials = new NetworkCredential( "email", "pass"); smtp.EnableSsl = true; Console.WriteLine("Sending email..."); try {smtp.Send(mail);} catch (Exception ex) {Console.WriteLine(ex.Message)}
Failed to send email