Please post the real error message that you are getting, along with the stack trace and identify the line of code that is getting the error. Unless you are really getting an SQL error, then post that code instead.

4 solutions

Solution 2

mike meinz is correct the UseDefaultCredentials should be false. Aside from that I would check the port as well the most commonly used ports are 10, 25, 110 465, and 587. I have personally had more luck with port 587.

not sure but i know in most cases the @domainname part must be included.
also ive noticed that you call the smtp.UseDefaultCredentials = false; after you specify the NetworkCredentials try calling the UseDefaultCredentials = false before you change the Credentials when i sent a message with gmail it must be done in this manner or an error will be thrown

try it on port 80 and alternating EnableSsl i know that when using yahoo EnableSsl must be set to false perhaps thats the case here. also check out http://support.godaddy.com/groups/email/forum/topic/cant-send-email-using-smtpout-secureserver-net/.
theres an interesting fix with the server address perhaps that may be of assistance to you

Solution 1

I found these two documentation items. Maybe one or both of these will help you solve this problem.

The documentation for SmtpClient.EnableSsl Property[^] says:If the EnableSsl property is set to true, and the SMTP mail server does not advertise STARTTLS in the response to the EHLO command, then a call to the Send or SendAsync methods will throw an SmtpException.

The documentation for SmtpClient.UseDefaultCredentials Property[^] says:Set this property to true when this SmtpClient object should, if requested by the server, authenticate using the default credentials of the currently logged on user. For client applications, this is the desired behavior in most scenarios.
The tag for your question says ASP.NET so it is not a Client Application. Perhaps UseDefaultCredentials should be False since you are supplying the credentials.