[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 596
  • Last Modified:

No connection could be made because the target machine actively refused it 127.0.0.1:25

I am trying to send an email from the ASP.NET page.
But I get the error
No connection could be made because the target machine actively refused it 127.0.0.1:25
I have the following code in my web.config file
  <system.net>
    <mailSettings>
      <smtp from="xxxx.com">
        <network
          host="localhost"
          port="25"
          defaultCredentials="true"
        />
      </smtp>
    </mailSettings>
  </system.net>

Actually the port 25 is blocked .if i try with anyother port I get the error .
I tried with port 465 also I got the same error.

can anyone suggest me which port I can use or how can I overcome this error and send an e mail from the Web page

thanks
0
asudhaa
Asked:
asudhaa
  • 2
1 Solution
 
käµfm³d 👽Commented:
Either you AV is blocking the port (McAfee does this well at my work), or the port is not open (i.e. the service is not running on the machine). Do you have an SMTP server running on your local machine?
0
 
asudhaaAuthor Commented:
I have McAfee in my PC.I have SMTP e.mail in the IIS.But when I run the command
telnet Localhost 25 I get the error
Connecting to local host.....could not open connection to the host on port 25.

Is SMTP running in my local machine or not?
What should I do to make SMTP run so that I can send e mail from the Web page?

Thanks
0
 
käµfm³d 👽Commented:
.I have SMTP e.mail in the IIS.
If this is a desktop machine, I don't believe there is (or rather I haven't come across) a built-in SMTP daemon, unless you're running a server edition of Windows, but I could be wrong. SMTP is a server role that should be set up in the management window of the server. The fact that you have settings configured in IIS is just telling IIS where your SMTP server is--it's not setting the server up as an SMTP server.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now