Below is an email script I spent the good part of today working on. What are some improvements I can make? My server got hacked recently, and the only script was a mail one, so there must have been some vunerability they used to get in (or they got the root p/w but it doesn't look likely) Feel free to use this on your own sites. I'm going to add in the option of using captcha soon
How about this, to be sure that you can't be hacked? After the user clicks "Submit", you write the exact e-mail in a text (.txt) file on the server. You send yourself a plain, safe, eMail with a link to that text file. In this way, you see exactly what tricks are played on you. You recorded the IP of the sender. Even if you can't find that person who sends spam, you can block that IP.
I haven't got any spam so far, so I haven't felt the need to add it in yet (the site isnt a top 100,000 alexa ranking or anything)