Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Justin 1 post 71 karma points
    Oct 24, 2017 @ 21:39

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

    I am trying to set up SMTP for a client of mine's Umbraco 7.7 website.

    The forms were built using the UmbracoForms plugin and everything seems to be fine on that side of things. The workflow is created and set to send the email to my email address.

    I'm running the website localhost and I do not have a license. (I've read that you can run localhost if you do not have a license. Please correct me if i'm wrong)

    I went into the web.config and added the client's SMTP settings and the form did not appear to send.

    I went into the Log files and saw that I am receiving this error:

    *System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it*

    I then tried to switch over to our personal SMTP credentials that I am 100% sure work, and I am receiving the same error.

    I cannot even receive an email from the "Forgot your Password" link on the login page.

    I checked our mailgun logs, and it looks like it never even made it there.

    Here are the SMTP credentials that I added to the web.config:

          <smtp from="[email protected]">
            <network host="" port="25" userName="***" password="****" defaultCredentials="false" />

    I even added my from email to the umbracoSettings.config file like this:

      <!-- the email that should be used as from mail when umbraco sends a notification -->
      <email>[email protected]</email>

    Here is the full error that I am receiving in the log file.

    2017-10-24 16:27:35,135 [P16856/D4/T45] ERROR Umbraco.Forms.Core.Providers.WorkflowTypes.SendRazorEmail - There was a problem sending a Razor email to '[email protected]' from Workflow for Form 'Contact Form' with id '0f36c378-bf45-44b2-8ce3-fcd4057b2a3a' for Record with unique id '03715450-5edd-4b5b-8443-ee16600b9db0'
    System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
       --- End of inner exception stack trace ---
       at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6)
       at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback)
       at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
       at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
       at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
       at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
       at System.Net.Mail.SmtpClient.GetConnection()
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       --- End of inner exception stack trace ---
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at Umbraco.Forms.Core.Providers.WorkflowTypes.SendRazorEmail.Execute(Record record, RecordEventArgs e)

    Any guidance would be greatly appreciated!

    Thank You

  • EJS 6 posts 89 karma points
    Oct 25, 2017 @ 10:34

    On the second line of the message in your logfile, it reads ‘’. That means you’re still trying on localhost (which is Probably you haven’t saved the web.config file after changing it... Or you have to restart your local application. By the way: I got the same error message when trying to connect to the SendGrid smtp service ( This appeared to be a problem with using port 25: despite their documentation only port 587 could be used. Hth

  • linehammer 2 posts 72 karma points
    Jan 22, 2020 @ 04:42

    This exception message says you're trying to connect to the same host ( ), while you're stating that your server is running on a different host. This 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., but not (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.

  • Jerry Matt 3 posts 73 karma points
    Oct 05, 2020 @ 11:32
    Jerry Matt

    Verify the WiFi connection

    First of all, you should check the wifi service through which your computer is connected. Also, you can try to change the wifi network when you can't resolve the connecting issue.

    Check Wireless Diagnostics

    You can search for wireless diagnostic on your computer and try to monitor the glitch which is causing trouble.

    Reboot Your Router

    You should try to reboot your router to get rid of the computer not connecting to wifi issue. In some cases, this kind of problem can be fixed by rebooting the router.

    Reboot Your Computer

    You can reboot your computer and check whether or not the issue is fixed. In most cases, you will be able to fix the wifi not connecting issue with computer experts.

    Check Your System Updates

    It may be the case that you haven't installed the system update or there is the partial installation of the update, you can uninstall the update and install it again so that you won't see such problems.

Please Sign in or register to post replies

Write your reply to: