Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Configuring Windows SMTP Service with PHP

Options
  • 16-04-2004 10:36am
    #1
    Registered Users Posts: 2,154 ✭✭✭


    Hey,

    I am wondering if it is possible to configure PHP to send mail through the Windows SMTP service. I have a server and no access to a mail server, but in ASP I can send mail no problem through the Windows SMTP service. Is it possible to do something similar with PHP?

    Below is the relevant piece of my php.ini.
    [mail function]
    ; For Win32 only.
    SMTP = localhost
    
    ; For Win32 only.
    sendmail_from = [email]noreply@server.com[/email]
    
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =
    

    When I try to send mail, I get:

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

    Anyone ever set this up?

    Failing that, anyone have any good tutorials for setting up a mail server? :) (And maybe recommendations on free ones to use?)

    Many thanks!

    Serb


Comments

  • Registered Users Posts: 25 ronanm


    Tried a few found this to be the easiest windows based server to setup and configure and its "Free for non-commercial use".

    Obviously, turn off your IIS SMTP server first.
    http://theemailserver.com/


  • Registered Users Posts: 2,154 ✭✭✭Serbian


    Hey Ronanm,

    Thanks for the suggestion. Unfortunately I need the SMTP service to be running since there are a bunch of ASP scripts running on the same server and I don't have a second server to run the mail server on. Guess I am just going to do without!

    Serb


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Weird, have you tried putting in 127.0.0.1 instead of localhost in your php.ini. In theory it shouldn't make a difference but sometimes it does. I have a ISS Smtp server sending mail fine from PHP scripts on Apache on my machine.

    :confused:


Advertisement