Exception: System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (10061): No connection could be made because the target machine actively refused it.

Imran Jalali 101 Reputation points
2023-06-20T11:14:42.6233333+00:00

Hi Folks,

When I try to send email using SMTP (PORT:25), I am getting the following error on my production environment

Exception: 
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (10061): No connection could be made because the target machine actively refused it. 192.168.100.20:25
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)

Our network infrastructure configured firewall settings and allowed the smtp port no 25. But I am still getting this error.

I re-contacted my network infrastructure team they told me there is no logs created (no connection requested) . Our website is hosted outside in the hosting provider and we connecting via VPN Network.

Any idea why I am unable to call SMTP mail gateway? Thanks!

Regards;

Developer technologies C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.