542
Views
3
Comments
Connection refused on 127.0.0.1
Question

Hey guys, not sure if I missed a step but I am trying to send emails from my application but I kept getting an error log for "No connection could be made because the target machine actively refused it 127.0.0.1:12003". I came across this link https://www.outsystems.com/forums/discussion/10838/connection-refused-on-127-0-0-112000/ and it helped me with sending an email on my personal environment. However when  I swapped over to my work profile on service studio (still on my personal laptop) and tried to send an email I was prompted with the same error log.

2025-12-11 08-02-29
Ferhat Karatay

Hi Miguel,

I see in your error message port 12003.
The default OutSystems scheduler service port is 12002 Is there any change about that?

https://success.outsystems.com/Documentation/11/Setting_Up_OutSystems/OutSystems_network_requirements

Which type are you using at your work on-premise or cloud?
Did you check SMTP settings on Service center > Administration > Emails section?

2018-10-26 14-33-16
Miguel Morell

Ferhat Karatay wrote:

Hi Miguel,

I see in your error message port 12003.
The default OutSystems scheduler service port is 12002 Is there any change about that?

https://success.outsystems.com/Documentation/11/Setting_Up_OutSystems/OutSystems_network_requirements

Which type are you using at your work on-premise or cloud?
Did you check SMTP settings on Service center > Administration > Emails section?

Good morning Ferhat,


I already configured my firewall to allow ports 12000-12004 be available. I also added 127.0.0.1 to my hosts file as a localhost. This was all done on my personal laptop and when I tried to send the email on my personal cloud environment it was successful. I then logged out and switched over to my work cloud environment to reproduce the same result but it failed. I did notice my email configurations was not updated so I fixed that and yet still got  an error message. 


UserImage.jpg
line hammer

This exception message says you're trying to connect to the same host ( 127.0.0.1 ), while you're stating that your server is running on a different host. This 127.0.0.1 represents a  'loopback' .  It allows the computer to communicate with itself via  network protocol .

Dns.GetHostEntry(IPAddress.Loopback).HostName returns the host name of your machine. When you pass a host name to  TcpClient , it will resolve it to one or more IP addresses using  Dns.GetHostAddresses(hostName) . This includes the public and local IP addresses of your machine (e.g. 192.168.12.10), but not 127.0.0.1 (loopback address). So your client is trying to connect to any of the non-loopback addresses of your machine, while your server is listening only on the  loopback address . So, no connection can be established. The solution to this problem is that connect to the  same end point  your server is listening on.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.