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);

8 comments:

Anonymous said...

thanxxx

Д.Цолбаяр said...

it is not working for me.

Anonymous said...

Thanks
It's working and i have solved out the problem with the help of your blog

Khanakia said...
This comment has been removed by the author.
Khanakia said...

thanks for the help
its working and finally my problem has been sort out

Anonymous said...

thanks your code helped

my life said...

still the error is server do not support secure connection

Sumit Kumar Singh said...

Thanks,

It's working fine!!