Looking for a secure PHP email script
November 16, 2005 3:18 PM
Subscribe
I need a PHP-based email script that will take the name, email, subject, and message form fields I pass to it and send them to me with the name and email used as the "From" field in the message header. I also need to put a value in the header that identifies the sender's IP address. And, of course, I need a script that is not vulnerable to header injection spam attacks. Any recommendations?
posted by punishinglemur to computers & internet (7 comments total)
1 user marked this as a favorite
As to how secure your script is, it depends on how you accept input. If you're accepting it from a FORM post, make sure that the referrer is from your own URL (so, no foreign POST actions). If it's from a GET, do the same, but god help you -- it's the easiest thing to overpower or just get wrong.
To get the sender's IP address, you have to depend on the Server variables from the web request, and then inject that into your custom headers.
posted by thanotopsis at 3:29 PM on November 16, 2005