0

I have a Windows 2003 server with PHP 5.24 installed on it.

I have read several posts (including the PHP manual page) on the Internet that say that sendmail_path in php.ini can be set to use a program such as Fake Sendmail which has the ability to push the mail file to my MDaemon pickup directory. I have downloaded that program and attempted to use it.

The problem is that sendmail.exe never gets executed.

sendmail_path = c:\SendMail\sendmail.exe

To verify it, I setup a simple batch file that writes to test.log when executed and changed the sendmail_path to point to the batch file. I verified the batch file does indeed create my test file when run from the command line, but when I try to send mail, the file does not get created.

sendmail_path = c:\SendMail\test.bat

The batch file never gets called.

I have tried a number of different things such as creating sendmail.exe in a path of /usr/lib/sendmail in both the c: root as well as the PHP programs folder but cannot seem to force PHP to use my file.

I have also tried putting the path name in single and double quotes, but nothing works.

In my PHP mail test I get get a fail msg and my PHP logfile shows the mail attempt to be delivered, so I know the mail process is being called.

Looking for some suggestions as to what to try next.

Gave up on trying to redirect PHP mail and just configured my servers SMTP settings to accept it. Although I had wanted to have my MDaemon mail server handle the workload, this method will suffice for the limited use it will get.

AnFi
  • 10,493
  • 3
  • 23
  • 47
FlashSolutions
  • 85
  • 1
  • 10
  • Did you restart your webserver after making the changes to your ini file? – BOMEz Mar 11 '14 at 16:09
  • Yes and No. I tried restarting several times but had no effect. Then I changed the php.ini file to use a different logfile name and discovered it gets used without restarting the web server, so I don't think I should have to take down my websites to test the sendmail_path. – FlashSolutions Mar 11 '14 at 16:39
  • After reconfiguring my SMTP server, I did have to restart IIS so you are correct in that the service needs to be restarted. – FlashSolutions Mar 11 '14 at 20:37
  • Did you fix this then? Try putting a pause command as the first line in your batch file. That should allow you to see if it is being launched or not. If not then try `sendmail_path = c:\windows\system32\cmd.exe /c "c:\SendMail\test.bat"` – foxidrive Mar 12 '14 at 09:37
  • No, I gave up. It just did not seem to honor sendmail_path because the batch file never executed. If it had, it would have saved a temp file that would have alerted me that it ran. Regardless of what I put in the path statement, it is just ignored. – FlashSolutions Mar 13 '14 at 10:17

1 Answers1

0

You have syntax error in php.ini! Just copy php.ini-development to php.ini and set:

SMTP = 
sendmail_from = 
sendmail_path = "c:\SendMail\sendmail.exe -t"

Or fix error in php.ini. Enjoy