I previously wrote a post about receiving e-mail and saving attachments with PHP. I was so focused on having solved that part of my problem that I neglected to write about how to send e-mail to a script in the first place. Thanks to a helpful commenter, today I am rectifying that oversight.
Here’s how I set up an e-mail address to be sent to a PHP script in CPanel.
First, go to the Forwarders section…
Click the “Add Forwarder” button…
Finally, enter your desired e-mail address and the name of the script you wish to have process your e-mails.
Not Using CPanel
This article over at Evolt.org looks like it has good instructions on setting up Sendmail, Qmail or Exim to forward to a PHP script. I have not tested those instructions so I don’t know that they work for sure, but the article seems well written so I would give them a try.