HTML and CSS Reference
9.4. Using Email to Collect Form Data
It is increasingly common to find authors who have no access to a web
server other than to upload their documents. Consequently, they have no
ability to create or manage CGI programs. In fact, some Internet service
providers (ISPs), particularly those hosting space for hundreds or even
thousands of sites, typically disable CGI services to limit their servers'
processing load and as a security precaution.
If you are working with one of the many sites where you cannot get a
form processed to save your life, all is not lost: you can use a mailto URL
as the value of the form's action attribute. The latest browsers automat-
ically email the various form parameters and values to the address sup-
plied in the URL. The recipient of the mail can then process the form and
take action accordingly.
By substituting the following for the <form> tag in our previous example:
<form method=POST action="mailto:firstname.lastname@example.org"
onSubmit="window.alert('This form is being sent by email, even
though it may not appear that anything has happened...')">
the form data gets emailed to chuckandbill when submitted by the user,
not otherwise processed by a server. Notice, too, that we have a simple
send out the form data. The alert tells the user not to expect confirma-
tion that the form data was sent (see Figure 9-2 ).