Failed to connect to mailserver

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nvduffer@gmail.com

    Failed to connect to mailserver

    I am running IIS5 on my XP Pro home computer and am unable to send
    email through my ISP's mail server. In the PHP.INI are two lines:

    smtp = smtp.telus.net
    smtp_port = 25

    I have opened port 25 on my own computer (do I need to though?) and I
    am able to telnet to the ISP's SMTP server. When I try to send an email
    from my PHP page I get the well-known error message:

    Warning: mail() [function.mail]: Failed to connect to mailserver at
    "localhost" port 25, verify your "SMTP" and "smtp_port" setting in
    php.ini or use ini_set() in [filename] on line 40.

    The strange thing is, the mail() function seems to be trying to connect
    to "localhost" and not "smtp.telus.net ". There is only one PHP.INI file
    (in C:\WINDOWS) and I have run phpinfo() to confirm that this indeed is
    the INI file being loaded. However phpinfo() states that the SMTP
    server is "localhost" and not "smtp.telus.net ".

    I added an ini_set("smtp", "smtp.telus.net ") right before the mail()
    function and got the same error: unable to connect to "localhost" .

    I am not running IIS's SMTP service, and I am stumped. Any help is
    appreciated!

  • Alvaro G. Vicario

    #2
    Re: Failed to connect to mailserver

    *** nvduffer@gmail. com escribió/wrote (10 Aug 2006 11:57:08 -0700):
    I am running IIS5 on my XP Pro home computer and am unable to send
    email through my ISP's mail server. In the PHP.INI are two lines:
    >
    smtp = smtp.telus.net
    smtp_port = 25
    >
    I have opened port 25 on my own computer (do I need to though?)
    Actually, you shouldn't ;-)
    The strange thing is, the mail() function seems to be trying to connect
    to "localhost" and not "smtp.telus.net ". There is only one PHP.INI file
    (in C:\WINDOWS) and I have run phpinfo() to confirm that this indeed is
    the INI file being loaded. However phpinfo() states that the SMTP
    server is "localhost" and not "smtp.telus.net ".
    Apparently, directives are case sensitive. Try to specify SMTP in
    uppercase, as in manual and comments:

    SMTP = smtp.telus.net
    smtp_port = 25



    --
    -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
    ++ Mi sitio sobre programación web: http://bits.demogracia.com
    +- Mi web de humor con rayos UVA: http://www.demogracia.com
    --

    Comment

    • nvduffer@gmail.com

      #3
      Re: Failed to connect to mailserver

      Wow the one thing I failed to check -- case sensitivity! I changed
      "smtp" to "SMTP", rebooted and now all is well in my world. Thanks very
      much for putting and end to my frustrations!

      Alvaro G. Vicario wrote:
      *** nvduffer@gmail. com escribió/wrote (10 Aug 2006 11:57:08 -0700):
      I am running IIS5 on my XP Pro home computer and am unable to send
      email through my ISP's mail server. In the PHP.INI are two lines:

      smtp = smtp.telus.net
      smtp_port = 25

      I have opened port 25 on my own computer (do I need to though?)
      >
      Actually, you shouldn't ;-)
      >
      The strange thing is, the mail() function seems to be trying to connect
      to "localhost" and not "smtp.telus.net ". There is only one PHP.INI file
      (in C:\WINDOWS) and I have run phpinfo() to confirm that this indeed is
      the INI file being loaded. However phpinfo() states that the SMTP
      server is "localhost" and not "smtp.telus.net ".
      >
      Apparently, directives are case sensitive. Try to specify SMTP in
      uppercase, as in manual and comments:
      >
      SMTP = smtp.telus.net
      smtp_port = 25
      >
      >
      >
      --
      -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
      ++ Mi sitio sobre programación web: http://bits.demogracia.com
      +- Mi web de humor con rayos UVA: http://www.demogracia.com
      --

      Comment

      Working...