Showing posts with label SMTP server requires a secure connection. Show all posts
Showing posts with label SMTP server requires a secure connection. Show all posts

Wednesday, April 8, 2009

The SMTP server requires a secure connection or the client was not authenticated. The server response was: denied access

Error while sending email...asp.net 2.0

"The SMTP server requires a secure connection or the client was not authenticated. The server response was: denied access

Reliable $1 Web Hosting by 3iX

you can resolve this error by setting
mailclient.UseDefaultCredentials = true; in the code you are using to send email. use this code

System.Net.Mail.SmtpClient mailclient = new System.Net.Mail.SmtpClient();
System.Net.NetworkCredential auth = new System.Net.NetworkCredential("support@abc.com", "123#");
mailclient.Host = "mail.abc.com";
mailclient.UseDefaultCredentials = true;
mailclient.Credentials = auth;
mailclient.Send(msg);