Click to See Complete Forum and Search --> : Trigger PHP script on New Email


auxone
05-17-2008, 10:37 AM
My file server is Linux, but I think my email server is IIS because it uses SmarterMail as the graphical interface.

What I need to do is trigger a PHP script that processes an email, but it has to happen as soon as possible after the email was sent. It seems like setting a Cron job to run the script every 5 minutes would be unwise.

I already have the script, and it works. It can check the email and do what I want with it, but currently I have to trigger the script manually. I need it to trigger on new mail.

Any suggestions?

Phill Pafford
05-19-2008, 12:10 PM
Hi auxone,

I would suggest something like this:

Use a perl script to monitor the directory, if a new email comes in the perl script would run the php script.

http://www.perlmonks.org/?node_id=283849

This might help

auxone
05-19-2008, 12:35 PM
Thank. I never tried Perl, so maybe that's the key I've been overlooking.