The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. y2sm48568819pfi.39 - gsmtp
MailMessage mm = new MailMessage("xyz@gmail.com", "xyz@gmail.com"); mm.Subject = "Password Recovery"; mm.Body = string.Format("Hi ,<br /><br />Your password is .<br /><br />Thank You."); mm.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential(); NetworkCred.UserName = "xyz@gmail.com"; NetworkCred.Password = "xyz"; smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mm);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)