Cant emails through exchange: An existing connection was forcibly closed by the remote host

[亡魂溺海] 提交于 2019-12-03 21:13:49

Got it!

Essentially it seems that this error (ErrorCode 10054) happens when you connect to a server successfully but then ask it to do something that it is not equipped to do.

In my case here is what happened:

  • I used to send mail through our front-facing mail server mail.mycompany.com
  • That is not the address of the exchange server though, it is the address you point your browser to to access outlook online.
  • This worked fine previously since non-web requests for that address were routed to the exchange server. At some point this policy was changed - in our case because spam management was handed off to AT&T. Of course I was not informed of any of this.
  • Since there was indeed a server running at that site it would let me connect to it but then drop the connection immediately (or possibly even not allow it to open all the way)
  • Setting the correct host-name fixed the problem.

Usually when I see that it's a configuration on the Exchange server. In our environment, our Network Admins must explicitly allow machines to use the Exchange server as a relay. If the machine my code is running on is not explicitly added to the server, I get this message. Hopefully that helps.

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