PHP ini file SMTP config is failing me left and right.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbatestblrock
    New Member
    • Sep 2007
    • 164

    PHP ini file SMTP config is failing me left and right.

    Okay, I have been searching all morning, and have found nothing on how to solve this, I hope I am to be posting this thread under IIS vs. PHP forum. Sorry if its in the wrong spot.

    So here is my SMTP section of my php.ini
    -------------------------------------------------------------------------
    [mail function]
    ; For Win32 only.
    SMTP = mail.website.co m
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = name@website.co m
    -----------------------------------------------------------------------

    When I try and submit my form, which I know works, I get this error on my page:

    [PHP]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:\Websites\TRR DNN\sendmail.ph p on line 95

    Warning: Cannot modify header information - headers already sent by (output started at C:\Websites\TRR DNN\sendmail.ph p:95) in C:\Websites\TRR DNN\sendmail.ph p on line 96[/PHP]


    What I dont understand is why it is saying there is any error at "localhost" when it should be looking for mail.website.co m

    I have ensured the php.ini file is saved, I have bounced IIS (6, on Windows Server 2003) by the way. Rebooted and everything.

    The email server is NOT on this machine, and I CAN to a:
    telnet website.com 25
    from this machine.

    I am juuust out of ideas. Any PHP, mail, IIS peeps that can help me out there that would be GREAT!
  • mbatestblrock
    New Member
    • Sep 2007
    • 164

    #2
    UPDATE:

    When checking the config with the phpinfo page I have notice something weird?

    The config path for the php.ini, according to this page is set to
    C:\WINDOWS

    when it is indeed set to C:\php

    Just an update, thought it might help?

    Another update,
    The loaded config file says NONE

    Comment

    • mbatestblrock
      New Member
      • Sep 2007
      • 164

      #3
      Sorry for posting like a mad man! I solved the problem, but I don't know why this was happening.

      Like I said, when I ran the phpinfo page it told me it was looking for the ini file in C:\WINDOWS. I don't know where it got that value from??? I had IIS set to look in C:\php and environment variables, and everything else. SO I just dumped the files from the php directory into the WINDOWS directory, and changed everything accordingly and now it works.

      I still don't have an answer for why it was looking in the windows directory, I have installed PHP on an identical setup before without this problem. SO I just thought Id follow up in case anyone else runs into this same case.

      Good Luck.

      Comment

      • dlynx
        New Member
        • Oct 2008
        • 3

        #4
        You might also want to try the mMail library found here:

        http://www.virtualthin king.com/loadhtml.php?wh ere=scripts&wha t=art_show.php& db_target=00000 000023

        Comment

        Working...