Hi I am trying to send a mail from my application and am getting the following error
Exception Type: System.Net.Sockets.SocketException
Exception Message: No connection could be made because the target machine actively refused it
Exception Source: System
Exception Target Site: Connect
---- Stack Trace ----
System.Net.Sockets.Socket.Connect(remoteEP As EndPoint)
(unknown file): N 00309
BossWare.Mail.SmtpTcpClient.Connect(hostName As String, port As Int32)
(unknown file): N 00101
BossWare.Mail.SmtpClientConnection.Connect(connectionArgs As IConnectionArgs)
(unknown file): N 00255
Any help will be great
ThanksTuesday, September 12, 2006 12:16 PM
You get this error when your try to connect to a computer on a specific port and the host computer is not listening for any request on that port.
Computer 'B' tries to connect Computer 'A' at port 8043 while Computer 'A' is running no service which is listening to accept incoming connection request at port 8043.
For two computer to establish a connection both must agree upon using the same port of connections.
I hope this will help you.
Best Regards,Thursday, September 28, 2006 7:58 AM
even I have the same issue , I am using ASPNETDEVELOPMENTSERVER to host my custom handler, after running the Test method , it hosts my handler for a while, and in the middle terminates ,which causes the error in my test method later.
does anyone has any idea , why this is happening.
Another interesting fact is , when I debug my test method , it works properly , no issues. but when I run it results in net socket exception .... cant connect to the port because the target machine actively refused it...
Any one has any idea on this , why is it hapening ???
ParagFriday, September 05, 2008 4:50 AM
I also faced this same issue while making client server chat app.
Its because I have written only client interface, so there was not server. and my app was trying to connect. if there is no server, then it will throw the above exception. so I think your smtp configuration might be wrong, check it. and firewall setting also.
K6/3 Erandwane Pune 411004 IndiaThursday, December 30, 2010 9:49 AM
Try Follow the steps
1. Select the site or Virtual Directory in IIS
2. In Feature View, Right side you see SMTP mail
3. if exists, Click to open a dialogbox
4. Goto Radio button "Store e-mail in pickup directory" enter a valid directory path,
5. Your SMTP starts working, it will not send mails, but all outgoing
mail formats you can see, this would be great while debugging,
insteading of choking your mail server.
Hope it helps,
HydPhaniThursday, September 06, 2012 12:22 PM
Better technical crowd available at
( everybody elaborating the question and networking fundamentals here :), please give a workable solution techies)
HydPhaniThursday, September 06, 2012 12:25 PM