今天,我的程序向smtp发送邮件失败,得到错误
Unable to read data from the transport connection: net_io_connectionclosed.
原来程序工作正常,,找了半天,发现是smtp的设置修改了,在网上找到了答案:
What this error means is that System.net.mail was unable to find the smtp server.
The answer will vary depending on whether you have a fixed IP or a dynamic IP but,
basically, you need to assign a valid IP to your smtp server.
With fixed IP's this is relatively straightforward.
With dynamic IP's it takes a bit of tweaking.
Open the IIS Manager and check the properties for the smtp server.
In the Default SMTP Virtual Server's properties, in the "Access" tab,
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )
You may