It should be possible. Check some of the threads for specifics, such as "How to automatically send a reply mail using PHP?". In particular, make sure you're not using the script as the command but are instead using the PHP binary and passing the script as an argument.