Can't auth to Gmail smtp via MailMessage & smtpClient
问题 I cannot figure out for the life of my why this isn't working SmtpClient smtp = new SmtpClient { Host = "smtp.gmail.com", Port = 587, UseDefaultCredentials = false, DeliveryMethod = SmtpDeliveryMethod.Network, Credentials = new NetworkCredential("myemail@gmail.com", "myGmailPasswordHere"), EnableSsl = true, Timeout = 10000 }; smtp.Send(mail); I get: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. I just