When I try to send an email, I receive the following error:
Unable to read data from the transport connection: net_io_connectionclosed.
The email sends when I run it on my local machine but as soon as I upload it to IIS it stops working.
Below is my mail settings in my web.config file:
<system.net>
<mailSettings>
<smtp from="">
<network host="MyEmailServer" port="25" userName="" password=""/>
</smtp>
</mailSettings>
</system.net>
It also seems to work on my server but only sometimes.
Any help would be appreciated, thanks.
I found a fix, could be useful if anyone sees this in the future. Instead of:
<network host="MyEmailServer" port="25" userName="" password=""/>I did:<network host="192.168.0.1" port="25" userName="" password=""/>Where 192.168.0.1 is the IP address of the server. Hope it helps