UnitedWebsite.net
513 Wilshire Blvd.,
Santa Monica, Ca 90401
Ph.: (310) 451-5151
Fax.: (310) 451-4736
inquiry@unitedwebsite.net

 

Home

Prices

Support

Agreement

Web Design

FAQ

Sign up!

Contact Us

 

 

Design By:



























go to top











































go to top











































go to top

CGI Scripting

Using the mailto Script
BASICS

The mailto script is used to gather data from a form and email it to the specified address. If you want to use forms on your web site to collect data from your customers, get feedback, or take orders, then you can use the mailto script.

The Form Page

Follow the steps below for using the mailto script.

  1. Create your HTML file with the form on it. Forms can be created using most Web authoring programs. If you don't know how to create forms, contact our web designer to help you.
  2. Once you've created your form, you will need to set the METHOD of the form to POST and the ACTION of the form to http://www.domain.com/cgi-bin/formmail.pl where domain.com is the name of your domain. The final code will look like the following.

    <FORM METHOD="POST" ACTION="http://www.domain.com/cgi-bin/formmail.pl">

    where domain.com is your domain name.

  3. You will also need to add the two hidden fields below in between the begin form tag and the end form tag:

    <INPUT TYPE="HIDDEN" NAME="RECIPIENT" VALUE="user@domain.com">

    <INPUT TYPE="HIDDEN" NAME="THANKURL" VALUE="URL_for_a_thankyou_page">

    where user@domain.com is the email address to which you want the data from the form sent and URL_for_a_thankyou_page is the URL of a page (e.g., http://www.acme.com/thankyou.html) that you will need to create telling the user that the data from the form has been sent.

    The words RECIPIENT and THANKURL are keywords that the script will need. Both keywords are case sensitive. You will get a Server error if the script does not find both of the keywords and if the cases don't match to the ones above.

Below is a sample form that you can copy and paste with very little modification.

<!-- begin sample html page -->

<html>

<head>
<title>Sample Form</title>
</head>

<body>

<h1>Sample Form</h1>

<hr>

<form method="post" action="http://www.domain.com/cgi-bin/mailto">
<input type="hidden" name="RECIPIENT" value="user@domain.com">
<input type="hidden" name="THANKURL" value="http://www.domain.com/thankyou.html">
<p>
<b>Name:</b><input type="text" name="name" size="30"><br>
<b>Email:</b><input type="text" name="email" size="30"><p>
<b>Comments:</b><br>
<textarea name="comments" rows="10" cols="50"></textarea>
<p>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>
<p>

<hr>

</body>

</html>

<!-- end sample html page -->

On the above sample form, you will need to replace domain.com with your own domain name and user@domain.com with the email address to which you want the data from the form sent. Feel free to copy and paste the sample form above to your favorite text editor and then save it as form.html.

You will also need to create your own confirmation (thank you) page. For your convenience, we have provided a copy and paste sample confirmation page below.

Sample Confirmation Page

The confirmation page is displayed after the visitor has clicked on the Submit button and the data from the form has been saved. As with the sample above, you may copy and paste from this directly into an HTML file.

<!-- begin sample thank you page -->

<html>

<head>
<title>Thank You!!!</title>
</head>

<body>

<center>

<h1>Thank You!!!</h1>

</center>

<p>
<center>
The information you provided has been sent. We will get back with you as soon as we can.
</center>
<p>

</body>

</html>

<!-- end sample thank you page -->

Feel free to copy and paste the sample thank you page above to your favorite text editor and then save it as thankyou.html.

Other Related Pages

Web Design
Frequently Asked Questions


User Friendly!!
Our customer support  agents are here to help you


E-Commerce solutions
Find out how to get the exposure your business needs!!


Free E-mail
Check your e-mail right from your site anywhere in the world!