The scheduled task execution PHP script project contains a script for sending emails. you need to read unsent emails from the database every two minutes and then send them out. I am running it in the browser. However, because you need to keep running, you want to use windows scheduled tasks for scheduled execution.
The bat file is written as follows:
D: \ wamp \ bin \ php \ php5.4.3 \ php.exe-q D: \ wamp \ www \ cron \ mailqueue-2min.php
However, if the code is executed, the message always fails to be sent.
Ask the question. What is the difference between php.exe execution and browser running?
Reply to discussion (solution)
-F should be used for the parameter.
D: \ wamp \ www \ cron \ mailqueue-2min.php in the reqiure or include Please use absolute address, is this problem!
D: \ wamp \ bin \ php \ php5.4.3 \ php.exe D: \ wamp \ www \ cron \ mailqueue-2min.php
Remove the-q in the middle.
The problem is solved, not the parameter problem. it is the configuration file problem. in the wamp environment I use, there are two INI files. the configuration in both files must be changed.