MichaelBluejay - 2:32 pm on Sep 23, 2012 (gmt 0)
hotwired, I've done this exact thing.
It doesn't matter whether you do it with Perl or PHP, either can handle this job just as well.
I'm not up on what off-the-shelf scripts are out there, since I write my own. And this is a big enough script that I wouldn't just whip up the code for you here, so I suggest starting to write it, and then post back here if you have problems.
(1) You've got to make sure that spammers don't hijack your script to send out spam to others. If your script doesn't mail to your site visitors, then it's easy to avoid exploits. But if you're collecting an email address and mailing to that address, then make sure to reject email address input that has multiple addresses entered (e.g., filter out things like "," "\n" "bcc:" "cc:").
(2) If the script is hard-coded to always mail you, then you'll know every time it's used.
(3) Save the data into a MySQL database, or in text files that are either above the webspace or in password-protected directories.
Hope that's enough to get you started.