Hello. .
Thought I would write something here in-case someone is having the same issues and can't figure out how to resolve them. We are running DNN Professional version 6.1.5 and was running the system on .NET 4.
Every now and again, we would get notification from end-users that they weren’t receiving e-mails from the DNN system and when this occurred, the DNN event logs would report: "Unable to read data from the transport connection: An established connection was aborted by the software in your host machine". Again, the issue with e-mails not going out would be VERY sporadic; sometimes no issues for days and then the next morning, three e-mail failure log entries over the past 6 hours.
We contacted DNN support and I even did some Microsoft support lookups about the error. Everything I read pointed to the server’s anti-virus causing the issues. Everyone said to test by disabling the anti-virus on the server to see if the issue would still occur. For some, this resolved their issues.
I did some testing and I ended up setting up a Portal Admin only-viewable page and installed the DNN feedback module on the page. I configured this accordingly so I could send the messages to a number of internal and external e-mail accounts. Then on the DNN webserver I had TCPView running so I could see the connections being made between our DNN webserver and our Mail server.
As I said, the issue was very sporadic and sometimes there aren't any issues when I clicked submit; e-mails were sent out. But then other times out of the blue, they failed to be sent out and I would get an error stating SMTP isn't configured correctly, etc.
What was odd is that TCPView on the webserver would show that there were three established connections to our mail server on port 25. When the e-mails are being sent out successfully, one of the three connections would close and a new connection would be made and the message was sent out fine.
Yet when I got the SMTP error, I would get an hourglass on the feedback form page and after a short time; it would error out about the SMTP error. What I would see with TCPView is that one of the three connections would not close as what normally happen with a successfully submitted form. Once I got the SMTP error on the screen, TCPView would show one of the port 25 connections closing, but it would not re-established.
If I resubmitted another test feedback form right afterward, the third connection would be made once again and my form was submitted without issues.
I then tested with our server IPSec ruleset disabled, with the w3wp.exe file exception configured within our anti-virus and even disabled our anti-virus. Even with everything disabled, we still had this issue.
My main question was why did DNN keep at least two SMTP connections established? Shouldn’t these connections be closed after every e-mail was being sent out by the system and is it needed that there are always established port 25 connections?
Long story short, it’s a known issue with .NET 4 and it’ll leave connections open after SMTP mail is sent out, and special coding is required; the SmtpClient class currently does not have a Close() or Dispose() method. You can read more about the issue here:
http://connect.microsoft.com/VisualSt...
DNN support also opened a ticket in Gemini to track this issue:
http://support.dotnetnuke.com/issue/V...
What we ended up doing to resolve our issue was rolling back our DNN installation from .NET 4 to .NET 3.5.1. Simply created a new App Pool using .NET 3.5.1 and told DNN to use this App Pool instead. Doing this though required us to edit our web.config file. See below for these changes.
Hope this will assist others if they’re having these same random, sporadic e-mail issues. Thanks..
Line 224 - From:
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="9216" requestLengthDiskThreshold="9216" executionTimeout="300000" shutdownTimeout="300000" requestValidationMode="2.0" />
To:
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="9216" requestLengthDiskThreshold="9216" executionTimeout="300000" shutdownTimeout="300000" />
Line 305-306 - From:
<!--<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />-->
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
To:
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />
<!--<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" /> -->
Line 310-311 - From:
<!--<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />-->
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
To:
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" xmlns="urn:schemas-microsoft-com:asm.v1" />
<!--<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" /> -->