Email failing to send

Discussion in 'Email' started by Willp89, Aug 1, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a contact form which I want to send an email to an address when it is submitted.

    I have written some code to do this and I am getting either one of two scenarios.

    The first I get this error message:

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

    I have the following settings in my config file:

    <system.net>
    <mailSettings>
    <smtp deliveryMethod="Network" from="Website &lt;[email protected]&gt;">
    <network host="localhost" port="25" />
    </smtp>
    </mailSettings>
    </system.net>

    Why would I be getting this error?

    The second scenario is when I try to send through my smtp so all that would change is the host. The email does come through with this but it always gets Greylisted and I have to wait 15 minutes to re-submit which wouldn't be practical on a live website.

    Any help would be appreciated - cheers.
     
  2. does anyone have any idea? Could it be a permissions issue with my account and using localhost as the host?

    Cheers
     
  3. dmitri

    dmitri DiscountASP.NET Staff

    For the first case, it looks like there are extra characters in "from" field. Try "[email protected]" instead of "Website &lt;[email protected]&gt;"

    for the second case, you are probably running into this error because your email account is greylisted. Please refer to the following knowledge base entry on how to disable greylising for your email accounts:

    http://support.discountasp.net/KB/a285/how-to-bypass-greylisting-in-smartermail.aspx

    For some additional information on greylisting, please take a moment to review the information presented in the following DiscountASP.NET Knowledge Base article:

    http://support.discountasp.net/KB/a282/what-is-greylisting.aspx
     
  4. Cool thanks for the reply.

    The host in the webconfig works ok it should serve the purpose of giving it a name like "Website <[email protected]>" except because it's an XML file I need to character encode the "<" ">" However this shouldn't affect the sending. I will double check this when I get home as I could be wrong.

    In the article about Greylisting it states that it is a useful feature but do most people find that they have to disable it in order to send / receive email ok through there smtp?
     
  5. Ok I am still getting the same error after making the suggested change in the web.config file:

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

    What could be causing this?
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page