Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm looking for a JavaScript code that will allow visitors to my website submit information that would go directly to my e-mail. The only one I've been able to find only opens the e-mail browser. Is there one that will automatically send the information to my e-mail box when they hit the Submit button? Thanks in advance!

You can't do it with JavaScript.
If you use the action="mailto:yourname@yoursite.com" in a form then the data entered in the form will be emailed to you, BUT it is dependant on using the visitors email application to do it. This may require the email application to open, it may do it silently, or it may require the users to confirm the action through a dialog.
The reason for all of that is security. We do not want web pages to access our applications or send email w/o our knowing about it.
If you want the ability to send data entered into a form w/o utilizing the user's email application, then you have to do it server-side. Most web hosts include CGI scripts on the server so you can accomplish this with just HTML. However, if your host supports PHP, ASP, or another server-side scripting language then you can create something even easier.
So, your first step is to determine what your host supports and this will determine what options you have.
Michael J

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

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