System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Below is the code:(Code Behind) public void SendMail(string ToMail, string subject, string Message) { MailMessage mailMsg = new MailMessage(); mailMsg.To.Add(ToMail); mailMsg.Subject = subject; mailMsg.IsBodyHtml = false; mailMsg.Body = Message; SmtpClient smtpclient = new SmtpClient(); smtpclient.EnableSsl = true; smtpclient.UseDefaultCredentials = true; smtpclient.Send(mailMsg); } Web.config: <system.net> <mailSettings> <smtp from="localtalentmail@gmail.com" deliveryMethod="Network"> <network host="smtp.gmail.com" port="587" password="**********" userName="mygmailId@gmail.com"/> </smtp> </mailSettings> </system.net> pls help me to solve this.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)