关于发邮件的服务器的端口号_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > 关于发邮件的服务器的端口号

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

 2016/6/30 5:31:16  AugustStone  程序员俱乐部  我要评论(0)
  • 摘要:今天搞一个发邮件的小功能,一切参数设置好,就是服务器没响应。一开始怀疑是邮件服务器设置不对,邮件服务器和outlook中找到的是一致的。怀疑端口号25不对。大部分资料都说是25呀。。。。后来找到这个网页,说Usuallyanoutgoingserveremploysport25:it'sthedefaultSMTPport.However,someIPsdenyitsusebecauseofthemassivespamandmalwaretrafficbywhichisaffected
  • 标签:邮件 服务器 服务

 

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

一开始怀疑是邮件服务器设置不对,邮件服务器和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。

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

 

发表评论
用户名: 匿名