Hey,

Im new to php and am having problems sending email from my personal server (IIS). Does anyone know how to set up php (or IIS) so that the server can send email?

Thanks 🙂

    Do you have the smtp setup in the php.ini file?

      it's not just about smpt config in PHP.INI it is whether you have a mail server setup on your comp.

      I found the smtp service that comes with IIS doesn't work, an easier option is Mercury win32 from www.pmail.com, it is only 2 MB to download and although the setup program goes on for ever use common sense and it will work. P.S I think you need to remove the mail part of IIS using Add/Remove from the CD.

      Once you have it make a mailbox yourname@localhost. In outlook type localhost for your POP3 server and SMTP server and username is the yourname@localhost thing. This is only capable of light load but this doesn't matter for developing scripts.

        a year later

        Hi,

        Can you post here how to properly configure Mercury Mail. I can't make it work.

        It's not sending any mails and I get this in Connection History:

        Current name service information:
        Hosts file : C:\WINNT\System32\drivers\etc\hosts
        Domain :

        15:38:22: processing job MO001310
        Temporary error 249 (temporary MX resolution error) resolving 'smart.com.ph'.

        Please help!

        Thanks.

          I havent used Mercury for a while however I will have a look tonight concerning how to configure it. If not, there are several other smtp servers that you can get off the net that may be easier to configure, also, recently I have found out that all of the pmail software is renowned for its awful setup procedures.

            I have just tried to get it working it work without success, to give yourself the least trouble I would reccomend sourcing another free server. One to try would be MailEnable. I seem to recall it was quite easy to use. Post again if you can't get that working.

              Hello,

              Thanks for the reply. I installed MailEnable but I get this error:

              mail(): SMTP server response: 503 This mail server requires authentication. Please check your mail client settings

              What could be the problem? What should I set in the php.ini? I'm a newbie here.

              Thanks... 🙂

                I have never seen authentication on a local smtp server before. I would first try looking at mailenable to see whether you can make the server open to everyone, however have a firewall and only allow localhost/lan traffic otherwise you could become an open relay.

                I can't see anything in php.ini for user details so it is probably the server which is the problem.

                  Hi,

                  I have just read this thread.

                  I have a problem using mail(). Some addresses receives the emails and some don't, but PHP does not give and error. In all cases it returns 1. The server I'm using is a windows server running IIS 5.0. Is this problem caused by the smtp server which might not work properly? I don't have access to change the settings on the server. A hint anyone?

                  Thanks.
                  Lasse

                    Fasan, the reason you are getting TRUE(1) returned everytime is because the PHP manual states that TRUE is returned when "mail was successfully accepted for delivery". I would interpret this as the server is accepting the message because it is in the correct format and follows the RFC rules, etc.

                    After the PHP script has finished executing, the mail server will then try and send the message and hold it and try again for a period of time if it is unsuccesful in finding the recepient.

                    Do you have access to error logs? They may be able to shed some light or you could try contacting the web admin.

                      Thanks.

                      I can't access the error log, but I wil try to contact the administrator. I guess other users of that server must have the same problem.

                        Write a Reply...