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("firstname.lastname@example.org", "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.