Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is related to an IIS server problem, or a PHP configuration, not php code.

I'm running an IIS6 server with PHP installed on it, the following php code will never send an email:

mail("user@example.com", "hi", "thanks"); //...mail(address, subject, message)

The server this is running under has a valid SMTP server, I know because I can telnet to localhost:25 and send emails by directly talking to the protocol, so that's not an issue.

However, this code won't send. I've looked at my php.ini file, and it looks like it's all correct to me also:

[mail function]
SMTP = localhost
smtp_port = 25

edit: I can confirm that programming that speaks to the socket with the SMTP protocol also works, but the mail() function still refuses.

share|improve this question
add comment

2 Answers

If you are using Authentication in your php.ini file then you need to use SMTP authenticate Scripts to send out the mail from the server.

share|improve this answer
add comment

check to see if you smtp service is running on the server.

easiest way is to open a command window, start -> run -> cmd

telnet localhost 25

see if you get any response, if not you need to start your smtp service.

share|improve this answer
    
I mentioned I could telnet into the service in my question. –  Incognito Nov 16 '10 at 21:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.