C# – SMTPException : Unable to read data from the transport connection: net_io_connectionclosed

cemail

I know that this question looks like duplicate of dozens other questions while its not.

When ever i try to send an email on my local machine through my web application an SMTPException is thrown and the exceptions is :

//on this line : SmtpServer.Send(mail);
Unable to read data from the transport connection: net_io_connectionclosed.

While the code on production is working perfectly, the same code, the same connections, the same credentials, i'm using IP instead of alias, i tried to turn off the firewall on my local machine, and nothing helped me to fix this issue.

While on my local machine is used to work previously, can anyone give just a hint what could be the problem that raising this issue?

Best Answer

If you are on a residential internet connection, quite often your ISP will block outgoing email sends by blocking all outbound connections to port 25. This is quite common here in the US. Try connecting to a local email server over TCP/IP, or to one on your own internal network.