An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Re: Unable to read data from the transport connection: net_io_connectionclosed

I am also getting this problem but randomnly and I cannot figure out what is going on. The IP address of the mail server is fixed. The machine running the web application does not have SMTP installed. The email addresses are valid and the email server is
setup to allow the relay to take place. Any other possibilities I am not looking at?

Re: Unable to read data from the transport connection: net_io_connectionclosed

Tried all the solutions above, and they don't fix this. The problem is that the connection to the mailserver isn't closed properly. It times out at the mailserver, then the .net connection (with or without pooling) on the webserver times out from being idle
too long. We've had all sorts of random errors, all relating down to the same re-use problem of the smtpClient pooling. The actual problem is that there is no proper way to close the connection once you're done.

Re: Unable to read data from the transport connection: net_io_connectionclosed

The other thing that can cause this problem... if mail server and the server hosting your code are two different boxes, it can also be a permissions issue. The mail server must allow SMTP connections from the server hosting your code. Grant the server hosting
your code permissions to initiate an SMTP connection with the mail server and that can solve this problem.

Re: Unable to read data from the transport connection: net_io_connectionclosed

Vike

The other thing that can cause this problem... if mail server and the server hosting your code are two different boxes, it can also be a permissions issue. The mail server must allow SMTP connections from the server hosting your code. Grant the server hosting
your code permissions to initiate an SMTP connection with the mail server and that can solve this problem.

This is very true. I ran into a similar issue. If you are running your exchange server with Virtualization, you need to configure the SmtpClient to the host IP of the Virtual Server, not the physical hosting server name or IP.

Hope this helps someone, took me the better part of two hours of frustration to realize what I was doing wrong.

Re: Unable to read data from the transport connection: net_io_connectionclosed

<div> <div> """"""""""""""""The other thing that can cause this problem... if mail server and the server hosting your code are two different boxes, it can also be a permissions issue. The mail server must allow SMTP connections from the server hosting your
code. Grant the server hosting your code permissions to initiate an SMTP connection with the mail server and that can solve this problem."""""""""""""""""""""" </div> </div>

Well if scfm.com is your company then usually smtp.scfm.com is the server. Otherwise you need to contact the email administrator for scfm.com to find out. If you are writing an application to relay email through the smtp host at that domain, then you need
to include a security context since most email hosts block relays.