[function mail() Windows XP]SMTP localhost

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • universalbitmapper

    [function mail() Windows XP]SMTP localhost

    Hi,

    I'm trying to send an e-mail from a .php script and ie6 returns this
    error:

    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 C:\wamp\www\PAM WD\chap11email\ sendmail.php
    on line 12

    I checked php.ini (line 606):

    [mail function]
    ; For Win32 only.
    SMTP = localhost

    OTOH I didn't find "smtp_port" in php.ini

    Maybe I should add :80 as port in php.ini?

  • Erwin Moller

    #2
    Re: [function mail() Windows XP]SMTP localhost

    universalbitmap per wrote:
    [color=blue]
    > Hi,
    >
    > I'm trying to send an e-mail from a .php script and ie6 returns this
    > error:
    >
    > 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 C:\wamp\www\PAM WD\chap11email\ sendmail.php
    > on line 12[/color]

    Yes, the IIS return such an error (not IE) when it cannot connect to a
    smtp-gateway.
    [color=blue]
    >
    > I checked php.ini (line 606):
    >
    > [mail function]
    > ; For Win32 only.
    > SMTP = localhost[/color]

    That is wrong
    the next line should be
    smtp_port = 25

    At least that is in every single php.ini file I ever saw. :-)

    [color=blue]
    >
    > OTOH I didn't find "smtp_port" in php.ini
    >
    > Maybe I should add :80 as port in php.ini?[/color]

    Huh?
    port 80 is NOT for smtp.
    port 80 is typically used for http.
    use 25 for smtp.

    And also: Are you sure you are running software on your localhost that
    accepts smtp-commands?

    If you are unsure, make the smtp-gateway something that you know to work,
    like your own ISP-smtp-gateway.

    Regards,
    Erwin Moller

    Comment

    • webramz@gmail.com

      #3
      Re: SMTP localhost

      You should have SMTP server running on localhost, or consider using
      your ISP SMTP.

      Behzad Nategh

      Comment

      • universalbitmapper

        #4
        Re: SMTP localhost

        Hi,

        Many thanks for your replies.

        I added the smtp_port = 25 line in php.ini and restarted WAMP, now I
        still get the warning, but I receive the e-mail sent from php.
        I have found a "SMTP on Windows" tutorial, it looks easy enough, only I
        wonder if this new SMTP service won't conflict with Apache ??


        Jean-Benoit MORLA

        I been flamed so often I'm a KFNewbee

        Comment

        • Erwin Moller

          #5
          Re: SMTP localhost

          universalbitmap per wrote:
          [color=blue]
          > Hi,
          >
          > Many thanks for your replies.
          >
          > I added the smtp_port = 25 line in php.ini and restarted WAMP, now I
          > still get the warning, but I receive the e-mail sent from php.[/color]

          Good so far.
          But still a warning?
          That is strange: You receive the email, that means everything works as
          expected and your localhost can handle the mailrequest, but PHP still
          produces the same warning saying it cannot connect to the SMTP-server on
          localhost?

          I think you still have some problem somehow. :-/
          (You guessed)

          Maybe you better show us some mailing-code you made so far.
          [color=blue]
          > I have found a "SMTP on Windows" tutorial, it looks easy enough, only I
          > wonder if this new SMTP service won't conflict with Apache ??[/color]

          No, appache don't care what PHP does when mailing (as far as I know).

          If you use a different OS, you need to check the mailsettings. (For *nix you
          typpically use a program called 'sendmail', but that is of no concern to
          your current problem.).


          [color=blue]
          >
          >
          > Jean-Benoit MORLA
          >
          > I been flamed so often I'm a KFNewbee[/color]

          By the way: What is a KFNewbee?

          Regards,
          Erwin Moller

          Comment

          • universalbitmapper

            #6
            Re: SMTP localhost

            Kentucky
            Fried
            Newbee

            You really opened my eyes with your replies, I discovered that I did
            not have Microsoft IIS on my XP home,
            so I downloaded Argos SMTP free, now it's installed, I still get error
            message "unknown user" from the
            php line where the $from variable is set, but I think I'll fix it soon,
            just by looking at the tabs and the menu
            options I slowly get the whole picture.

            Many many thanks from Paris, Kentucky

            Jean-Benoit MORLA

            Comment

            Working...