Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Sending email is timing out

$
0
0

I do not know why but this code seems to be fine but i get time out error:

System.Net.Mail.SmtpException was unhandled by user code
Message=The operation has timed out.

SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 465;
smtp.Credentials = new System.Net.NetworkCredential("test@test.com", "test12345");
smtp.EnableSsl = true;
smtp.Send(mail);

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<trust level="Full" />
</system.web>
<system.net>
<mailSettings>
<smtp from="test@test.com">
<network host="smtp.gmail.com" password="test12345" userName="test@test" defaultCredentials="false" />
</smtp>
</mailSettings>
</system.net>
</configuration>

Any issues above? What else can I try doing?


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>