View Full Version : HTML "Form to Email" Question

August 15th, 2006, 07:27 AM
I'm trying to create a short survey for a site I'm building. I'm using radio buttons for the answers to questions. Now, at the end of the survey, I have a "submit" button. What I want that button to do is send an email to a preset address with the form data in the body. I have already tried the "mailto" command, but the problem with that is it opens the mail client first. I want it to send the email as soon as the "submit" button is hit. Is this possible?

August 15th, 2006, 08:41 AM
You need a server-side backend, i.e. a CGI, ASP, PHP or other script. There are readymade such that would take all arguments from a form and create a mail with each value line by line. Theoretically, you might be able to do it in e.g. JavaScript as well, but I don't know if you can send e-mail via the default e-mail client without opening it.

August 15th, 2006, 08:49 AM
Just do a quick google on FormMail and you should be set. Be careful that you don't select one with known or popular exploits.

Good luck!

August 15th, 2006, 09:22 AM
As above, you either need to use a server-side coding (like PHP) or use a third party website who offer it for free.

I've used PHP on my site, but the SPAM robots still get it :( I'll have to try to put one of those annoying "type the code you can barely read" things on it :D

August 15th, 2006, 10:03 AM
Of course a mail form should never be set up to send e-mail from anyone to anyone, just mail to you or selected addresses. Regarding spam, I'm running an old-fashioned guestbook that was flooded with automated spam until I added one more field: "Enter the four letter acronym associated with this website". Intelligent humans will recognize it immediately, bots leave it empty or put random junk there. So far, not a single spam on three months has arrived in that guestbook.