Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Configuring Windows SMTP Service with PHP

  • 16-04-2004 10:36AM
    #1
    Registered Users, Registered Users 2 Posts: 2,206 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 Posts: 2,206 ✭✭✭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, Registered Users 2 Posts: 68,173 ✭✭✭✭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