关于发邮件的服务器的端口号

2018-06-18 04:33:05来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

 

今天搞一个发邮件的小功能,一切参数设置好,就是服务器没响应。

一开始怀疑是邮件服务器设置不对,邮件服务器和outlook中找到的是一致的。

怀疑端口号25不对。大部分资料都说是25呀。

。。。

后来找到这个网页,说

Usually an outgoing server employs port 25: it's the default SMTP port. However, some IPs deny its use because of the massive spam and malware traffic by which is affected. This issue is raised in particular when you need to switch to another ISP – for instance, when you're travelling and connecting to a new provider. In this case you can try to use port 587 or port 465 to avoid the block. 

More in detail: port 587 is supported by almost every outgoing SMTP server and it's useful for unencrypted or TLS connections; while port 465 is the right choice if you need to connect via SSL.

摘自:http://www.serversmtp.com/en/port-for-smtp

即:25是默认端口,可能因为spam等原因用不了,这时可以考虑587.一般对于非加密的请求587都能用。

修改端口号为587后,果然OK。

 

 

附:

C#开发邮件客户端使用SmtpClient。

使用原理:需要设置邮件服务器地址,及端口号。

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:设计模式之命令模式

下一篇:ASP.NET Core 运行原理剖析1:初始化WebApp模版并运行