System.Web.Mail works, System.Net.Mail doesn't

211 Views Asked by At

I am writing an application that has to send some emails. After testing for quite some time i have found the following:

My System.Net.Mail based mail solution doesn't work. The error i get from the mail server is:

Unable to read data from the transport connection: net_io_connectionclosed.

Tested by using Telnet running on the same server as my application and then everything works!

My colleague suggested to test a copy of my solution, converted to using System.Web.Mail. And this solution works!

Could it be that this specific mailserver has problems connecting/accepting mail from the System.Net.Mail component? For now, all i know is that it's a machine running on CentOs.

1

There are 1 best solutions below

0
On

I even got the same problem..

My problem is solved by changing port number. So, i think your problem might be related to port.

Change you port to the port number of the server hosting your address.

It might help you to solve your problem.