How to run a script when a new email arrives?

  • Answered
When a new email arrives, I want to run a script.
That script will look at the subject line, and if "Request Free License Code" is in the subject line, it will send them an en email.
I have /public_html/cgi-bin/ script that checks my inbox for a new mail, and sends an email if it detects that string in the subject line. It works fine, I just need it to run when a new email comes in. I can run it as a cron, but that seems wasteful. Any ideas how I can run the script when a new email comes in?


Thank you for your question on having a script run when a new email arrives. On shared servers, accounts do not have the access to set up a script to do this other than on a timed cron. If you have one that is working for you at the moment, that should be fine. Placing it on a cron just checks by time vs being triggered by an event.

Kindest Regards,
Scott M