smtp error: unable to connect to remote server...No connection could be made because the target mach

Discussion in 'ASP .Net' started by Homer, Aug 11, 2007.

  1. Homer

    Homer Guest


    I got "InnerException: Unable to connect to remote server"..."No
    connection could be made because the target machine actively refused
    it" when I attempted to send an email through my Intranet app that is
    written in 2.0. The smtp server is a local server and it uses
    Port 25. The Authentication is set to Anonymous Access. Here's my

    <network host="" />

    Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles SendEmail.Click
    Const ToAddress As String = ""
    Dim mm As New MailMessage(UsersEmail.Text, ToAddress)
    mm.Subject = Subject.Text
    mm.Body = Body.Text
    mm.IsBodyHtml = False
    Dim smtp As New SmtpClient
    End Sub

    In the <network host.. /> section, I did not specify a username and
    password because I set the smtp server authentication mode is set to
    Anonymous Access. Can someone please tell me what I did wrong? I
    couldn't find anything on the Web that could point me in the right

    Homer, Aug 11, 2007
    1. Advertisements

  2. Homer

    Guest Guest


    First of all let's check if it's a problem of server/client configuration,
    or if it's .net code problem.

    Try to send an e-mail using the command line:

    Now, check if there are some security restrictions (E.g., authentication,
    or some times the "from" must have some well know domain name). Check as well
    if you SMTP server accepts calls from client computers (some time is just
    configured to work locally, it doesn't accept petitions from other computers
    to avoid spam).

    A good support material:

    .net fx 2.0

    .net fx 1.1

    Good luck

    /// ------------------------------
    /// Braulio Diez
    /// ------------------------------
    Guest, Aug 11, 2007
    1. Advertisements

  3. Homer

    Homer Guest

    Hi Braulio

    I confirmed that the SMTP server does not have any access restriction.

    In the Access tab:
    Authentication: Anonymous Access
    Connection: All except the list below. There's nothing in the list.
    Relay Restriction: Only the list below. In the list below, I granted
    access to my development PC using its IP address. I also granted
    access to as well as checking the "Allow all computers which
    successfully authenticate to relay, regardless of the list above.

    In the Security tab:
    Grant operating permission to these windows user accounts:

    How do I this?
    ....Check as well
    Homer, Aug 13, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.