I'm using PHP (5.2.9-2) on a IIS 6 Windows 2003 server. The email server is on another machine - Exchange server. When the mail function tries to send the mail I get the folowing in the php error log: WARNING: mail() [function.mail]: Could not execute mail delivery program 'C:\WINDOWS\sendmail\sendmail.exe -t' In file: E:\www\mail.php
I use sendmail from glob.com.au. It is properly configured since trying to send the mail from the command line is successful. The code for the bat file can be found here:PHP Sendmail not working on Windows Server 2003 (IIS)
The sendmail.ini :
smtp_server=MyServerIpAddress
smtp_port=25
smtp_ssl=auto
default_domain=mysite.com
error_logfile=error.log
debug_logfile=debug.log
auth_username=myusername
auth_password=mypass
force_sender=myusername@mysite.com
The debug.log remains unchanged after trying to send the mail in php, but shows the correct stuff when sending in command line.
The php.ini file is:
[mail function]
; For Win32 only.
SMTP = MyServerIpAddress
; For Win32 only.
sendmail_from = myusername@mysite.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "C:\WINDOWS\sendmail\sendmail.exe -t"
Interestingly enough, when running the php emailtest script from the command line, that works too! So only running it on the website it doesn't work...
I tried with and without force sender, sendmail_from, smtp_ssl auto/none/...
The PHP executable, and sendmail executable is in the PATH envinronment variable (tried an echo), but I didn't restart the server. Both have execute permissions, I tried even for everyone to have that ... nothing. I moved the executables in and out of windows folder. After each operation I restarted the IIS server, nothing...
Any hints would be appreciated
The php mailtest file tries to send from my address to the same address.