PDA

View Full Version : Contact Form Script with E-mail verification


WebsiteMaven
June 15th, 2006, 15:32
Does anyone know of any free contact form scripts that defeat bogus contact form inquiries by having the form automatically send an e-mail back to the user which he must verify before the script will process and send you the contact form.

In other words, I want the contact form to work like this:

1. User fills out form with e-mail.
2. Script sends e-mail to user saying "Please verify that this is you e-mail addres"
3. If user does not respond then the form is never sent to me.
4. If user responds to query then form processes.

Thanks in advance for any help.

chaos
June 15th, 2006, 19:07
What kind of Script Language were you trying for. There are a lot of form processors, so did you want PHP, AJAX, Javascript, PERL, CGI etc.?

There are two ways I can think of to accomplish your goal since of those processors I am not sure how many have the validation. You can use a database to temporarily store the email until the "unlock" it with a validation email, or you can have the form processor send the email back to the user (not directly to you) and have a script add a line of text to the top of the email saying "Click here if you are *John Doe*". If they click the link (effectively validating the email) then it forewards the email to you without any use of databases. Thats just my two cents though, and someone is bound to correct or find a better way. .:lol:

WebsiteMaven
June 15th, 2006, 22:16
I'm not really set on a particular script language.

I'm not really looking for ideas on how to code it myself. I don't have the skill. I was hoping some folks might know of some existing scripts. The script you're describing sounds like a good idea.

chaos
June 16th, 2006, 03:50
That was just the idea of how I would do it if I had the time or motivation to write my own. Unfortunately for you mate, I did some very thorough Googe searching, and still have yet to find one that requires email input from the users in order to email you. In practice, I think you would find that this woudn't work very well, as the entire purpose of having a form is to keep both of your emails anonymous if at all possible, and not use an email client if possible. Your best bet for blocking spam would be to just get a regular PHP form mailer with some advance security settings, and a validation script that checks to be sure that the email doesn't contain malicious script when it is submitted. You are never going to stop spam, so just do what I did and get used to it (and set up a bunch of Outlook keyword blockers etc.). If you can give me a couple minutes I will see if I can dig up any regular form mailers with high security.

chaos
June 16th, 2006, 04:00
http://www.dagondesign.com/articles/secure-php-form-mailer-script/
This code looks to be the best, as the article describes it's anti-injection validator on Submit. Very secure PHP.
http://www.arkie.net/~scripts/mailme/view_enhanced_source.php
This looks good, as it has an excellent Java validator on the emails, and the PHP looks solid too.

I hope some other people have opinions though, because I don't have any experience with these or any other PHP ones. Best of luck!

the_pm
June 16th, 2006, 04:11
Rich, are you trying to put together a form to submit email to yourself, that won't allow spam or give away your mailing address? If so, there are many good ones out there. I typically recommend FormM@iler (http://www.dbmasters.net/index.php?id=19) to people.

If you're trying to create a secure, open relay, that's another matter (and I'm not sure the words secure and open should be used in the same sentence). Is this your intention, a script anyone can use to email anyone, but requiring verification such that a bot couldn't use it?

chaos
June 16th, 2006, 04:57
I think what he wants is something like this (feel free to correct me).

1) On a comments page of his website (just an example) he will have a form that takes the users email and their comment.

2) Form is inputted to a database, and an automatic email is sent to the user via the email they put in their email. This email will contain a "ticket" number connected to the email being stored in the database.

3) When the user recieves the email they will find a link and a message telling them to click it to validate their email address.

4) Upon clicking the link, the email is sent from the database and to the owner's personal email address.

I typically recommend FormM@iler to people. Thanks for reminding me. That was one that I couldn't remember for the life of me.

the_pm
June 16th, 2006, 05:38
Thanks for reminding me. That was one that I couldn't remember for the life of me.The big reason why I like recommending it so much is because it's the only secure script I've ever found that allows you to send attachments.

It's a great script regardless, but that attachments part is a huge bonus when you need this sort of functionality!