Help with mail using php and apache on windows XP

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

    Help with mail using php and apache on windows XP

    Hi everybody,
    I have been trying to write a simple mail script using PHP and apache
    on Windows XP. Eventhough the script is saying that the mail is
    successfully sent, I am unable get it in my mailbox(I have given my
    mail address in $to). I am using the mail() function and I have made
    the following changes in php.ini

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

    smtp_port = 25

    ; For Win32 only.
    sendmail_from = aaa@Comcast.net

    CAn anybody help me with this?

  • Ken Robinson

    #2
    Re: Help with mail using php and apache on windows XP


    Karuna wrote:[color=blue]
    > Hi everybody,
    > I have been trying to write a simple mail script using PHP and apache
    > on Windows XP. Eventhough the script is saying that the mail is
    > successfully sent, I am unable get it in my mailbox(I have given my
    > mail address in $to). I am using the mail() function and I have made
    > the following changes in php.ini
    >
    > [mail function]
    > ; For Win32 only.
    > SMTP = localhost
    >
    > smtp_port = 25[/color]

    Do you have a mail server running on your local machine that is
    listening on port 25? If you don't this isn't going to work. You
    probably want to put the address of your ISP's mail server there, not
    localhost.

    Ken

    Comment

    • Pedro Graca

      #3
      Re: Help with mail using php and apache on windows XP

      Karuna wrote:[color=blue]
      > I have been trying to write a simple mail script using PHP and apache
      > on Windows XP. Eventhough the script is saying that the mail is
      > successfully sent, I am unable get it in my mailbox(I have given my
      > mail address in $to). I am using the mail() function and I have made
      > the following changes in php.ini
      >
      > [mail function]
      > ; For Win32 only.
      > SMTP = localhost
      >
      > smtp_port = 25
      >
      > ; For Win32 only.
      > sendmail_from = aaa@Comcast.net
      >
      > CAn anybody help me with this?[/color]

      If you have a SMTP server installed (and correctly configured) on your
      machine, you should have no problem with that php.ini.

      But ...

      I doubt you have a mail server installed on your machine.
      You have to specify an /existing/ mail server for the SMTP entry in
      php.ini.

      Try putting in SMTP the same server you have for your mail client
      (Outlook Express????) and in sendmail_from an address for that server,
      eg:

      SMTP = example.com
      sendmail_from = user@example.co m


      --
      Mail to my "From:" address is readable by all at http://www.dodgeit.com/
      == ** ## !! ------------------------------------------------ !! ## ** ==
      TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
      may bypass my spam filter. If it does, I may reply from another address!

      Comment

      • rick.martinez@gmail.com

        #4
        Re: Help with mail using php and apache on windows XP


        Pedro Graca wrote:[color=blue]
        > Karuna wrote:[color=green]
        > > I have been trying to write a simple mail script using PHP and[/color][/color]
        apache[color=blue][color=green]
        > > on Windows XP. Eventhough the script is saying that the mail is
        > > successfully sent, I am unable get it in my mailbox(I have given my
        > > mail address in $to). I am using the mail() function and I have[/color][/color]
        made[color=blue][color=green]
        > > the following changes in php.ini
        > >
        > > [mail function]
        > > ; For Win32 only.
        > > SMTP = localhost
        > >
        > > smtp_port = 25
        > >
        > > ; For Win32 only.
        > > sendmail_from = aaa@Comcast.net
        > >
        > > CAn anybody help me with this?[/color]
        >
        > If you have a SMTP server installed (and correctly configured) on[/color]
        your[color=blue]
        > machine, you should have no problem with that php.ini.
        >
        > But ...
        >
        > I doubt you have a mail server installed on your machine.
        > You have to specify an /existing/ mail server for the SMTP entry in
        > php.ini.
        >
        > Try putting in SMTP the same server you have for your mail client
        > (Outlook Express????) and in sendmail_from an address for that[/color]
        server,[color=blue]
        > eg:
        >
        > SMTP = example.com
        > sendmail_from = user@example.co m
        >
        >
        > --
        > Mail to my "From:" address is readable by all at[/color]
        http://www.dodgeit.com/[color=blue]
        > == ** ## !! ------------------------------------------------ !! ## **[/color]
        ==[color=blue]
        > TEXT-ONLY mail to the whole "Reply-To:" address ("My Name"[/color]
        <my@address>)[color=blue]
        > may bypass my spam filter. If it does, I may reply from another[/color]
        address!

        Are you sure that the mail function return TRUE?

        If it is, I found this note on the PHP.net website that said the
        following. I hope this helps:

        -------------------------------------------
        Quote from PHP.net
        -------------------------------------------
        thomas at nimstad dot com
        01-Oct-2004 01:40
        Under win32 you must! set sendmail_from in php.ini to solve the
        error: "sendmail_f rom" not set in php.ini or custom "From:" header
        missing. Only setting the headers correctly won't do. When set, the
        "From:" header will be used :-)
        -------------------------------------------

        -------------------------------------------

        Hope this helps, good luck.

        Comment

        Working...