Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
does anyone know if there is a way to send form data by email without using a cgi? I know I can use the "mailto", but I'd like to just send the form data on submit without having the user enter data thru their email client - I just want to populate the fields on the form (like "name" and "comment"), and when the user hits the submit button, it sends the form data by email without going to a cgi. My dad asked for my help in this (that's why I'm researching it now), and his web hosting provider doesn't allow cgi's to be executed (any executables actually), so I have to see if I can do it thru javascript. Can't seem to find anything on the internet on this subject, so I thought I'd poke the brains of experts here.
I told him I don't think it's possible, but I haven't dabbled in Javascript in years, so maybe things have changed...I hope?
If anyone's got pointers, or links, or suggestions, I'd appreciate it.
Thanks in advance for your help.
D.O.

I'm no expert on the subject by any means, but I don't think this is possible. JavaScript is client-side, and from what I think I'm reading, you want it to be server-side. I'm pretty sure you can only mail stuff via cgi or php or something. There is a way to do it with just an html form and no script, but I don't think that that would for you anyway.
-zeroguy

As zeroguy said, the strict answer to your question is No. I wouldn't expect any future versions of javascript to support this either...It seems like it would be too great a security risk. I'm also sure your users appreciate you not wanting to use the mailto method. This method is annoying and hardly ever works, so I'm glad you had the sense to avoid it.
Nevertheless, don't despair...All you know is that you can't use CGI in YOUR server...This says nothing about having your form go to a CGI on somebody else's server and have them e-mail the form results back to you. MadHaven posted a link to hostedscripts.com a while back...They'll do what you need and a lot more, all for free. I've never actually used their services (I would die without some kind of CGI on my accounts) but they seem to be good.
Hope this helps,
-SN

Ahhh, great idea :) I never thought of that, and I'll check into it for sure!
Thanks for your input folks!! Much appreciated!
D.O.

Don't bother with this, but server-side javascript supports email. Honestly, aside from Netscape Enterprise and Sun iPlanet, you don't see this kind of thing very often.
http://docs.sun.com/source/816-6410-10/sendmail.htm

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |