Sending email using Gmail gives a time out error

…衆ロ難τιáo~ 提交于 2019-11-30 12:08:44
Matt Wilko

Try using a different port number. You cannot use port 465 with System.Net.Mail as it only supports "Explicit SSL". Have a look at this page for more info on this.

Gmail will accept port 25 or 587 when sending mail via VB.NET but times out using port 465.

Also make sure you have UseDefaultCredentials = False

Also have a look at this example on how to send mail using GMail in C# it might give you some more clue.

I had similar problem, in my case I just forgot to specify the protocol, so instead of smtp.gmail.com I had to put ssl://smtp.gmail.com.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!