Using the mailsend.cgi script
Using the mailsend.cgi script

The mailsend.cgi is designed to take the contents of a form and mail it to a designated email address. It will strip out all the weird characters and create a message that is easy on the eyes.

To use it, make sure your form has all the necessary variables configured. Here is a list of required and recommended variables:

REQUIRED

sendto       - the email address where you want the data sent
redirect     - after they fill out a form, people get sent to this url

RECOMMENDED

subject      - the subject of the email sent to you
user_email   - the email address of the person filling out the form
user_name    - the real name of the person filling out the form
required     - a space-delimited list of all variables that you want required
env_report   - a space-delimited list of $ENV variables you want to know about
               such as: REMOTE_ADDR REMOTE_HOST HTTP_USER_AGENT etc.
As an example, here are the contents of a typical html file that makes use of the mailsend.cgi:
<HTML>
<BODY>
Fill out this form to tell me about yourself
<P>
<PRE>
<FORM METHOD=POST ACTION="/cgi-bin/mailsend.cgi">
<INPUT TYPE=HIDDEN NAME="sendto" VALUE="[email protected]">
<INPUT TYPE=HIDDEN NAME="redirect" VALUE="http://www.anydomainatall.com/thanks.html">
<INPUT TYPE=HIDDEN NAME="subject" VALUE="Test Form">
<INPUT TYPE=HIDDEN NAME="required" VALUE="subject user_email user_name">
<INPUT TYPE=HIDDEN NAME="env_report" VALUE="REMOTE_ADDR HTTP_USER_AGENT">
Your full name:     <INPUT NAME="user_name" SIZE="30">
Your email address: <INPUT NAME="user_email" SIZE="30">
Your shoe size:     <INPUT NAME="shoe_size" SIZE="5">
<INPUT TYPE="SUBMIT" VALUE="Send Information">
</PRE>
</FORM> 
</BODY>
</HTML>


That's all there is to it.

Go back to the Virtual Site Administration Page