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

Posted on 2011-04-26
Last Modified: 2012-05-11
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
I have the following code in my web.config file
      <smtp from="">

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

Question by:asudhaa
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    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?

    Author Comment

    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?

    LVL 74

    Accepted Solution

    .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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now