I've been asked to alter a PHP.ini file on a windows 2008 machine running IIS so that the [man]mail[/man] function will work on a remote SMTP server rather than localhost. The remote server requires a username and password which I have obtained, but the mail function is failing with this new configuration (it worked before when it was set to localhost).
Per this page, I have put these PHP.ini configuration values in :
[mail function]
SMTP = host.domain.com
smtp_port = 25
username = myusername
password = s0m3p4ssw0rd
mail.log = "C:\Windows\temp\php-mail-log.log"
When I visit a test script, there is a long pause before it says "not ok";
<?php
if(mail('me@mydomain.com','test subject','test message')){
echo('ok');
}
else{
echo('not ok');
}
?>
I suspect that there is no SMTP server responding on port 25 and this is why it times out. I have been unable to locate any mail-related errors in the main php error log and the mail log location i specified above is completely empty.
Any advice about how to proceed here would be most appreciated.