Using form to mail

Form to mail is a process where by a visitor to your web site can send you information via e-mail by filling in an online form. The form must be designed so that it contains all the information necessary to deliver the information to you and to notifty the user of the status of the form to mail processing. Rather than go into long explanations, here is a sample form that you can modify and put your own details into.

   <form method="post" action="http://www.inca-internet.com:/cgi-bin/mailform.exe" name="form">
    <input type="hidden" name="_1_MailTo" value="tellme@inca-internet.com">
    <input type="hidden" name="_1_MailServer" value="mail.inca-internet.com">
    <input type="hidden" name="_1_MailSubject" value="Enquiry from web site">
    <input type="hidden" name="_1_FailureDocument" value="contact_failure.htm">
    <input type="hidden" name="_1_MailFrom" value="visitor@website">
    <input type="hidden" name="_1_SuccessDocument" value="contact_success.htm">
    <input type="hidden" name="_1_RequiredFieldDocument" value="contact_fieldmissing.htm">
The first part of the form contains all the system parameters. You will notice that all parameters begin with _1_. This tells the form to mail program that these are system parameters. A list of the system parameters is given below:-

_1_MailTo E-mail address of person to send the mial to
_1_MailServer Your outgoing SMTP mail server
_1_MailSubject Text to insert in "Subject" line of mail
_1_FailureDocument Page to display if mail to form fails
_1_MailFrom Description to say wher mail is from ie form website
_1_SuccessDocument Page to display when mail delivery succeeds
_1_InvalidCardDocument Page to display if a credit card field is incorrectly filled in
_1_RequiredFieldDocument Page to display if a compulsory field has not been filled in

Next comes the part that the user fills in:-

          <table border="1" align="center">
           <tr bgcolor="#E5E5D1"> 
            <td width="204">Your Name (required)</td>
            <td width="216"> 
             <div align="center"> 
              <input type="text" name="_4_name" size="29">
             </div>
            </td>
           </tr>
           <tr bgcolor="#E5E5D1"> 
            <td height="4" width="204">E-mail (required)</td>
            <td height="4" width="216"> 
             <div align="center"> 
              <input type="text" name="_4_email" size="29">
             </div>
            </td>
           </tr>
           <tr bgcolor="#E8E8E5"> 
            <td width="204">Comments</td>
            <td width="216"> 
             <textarea name="_5_comments" cols="25" rows="3"></textarea>
            </td>
           </tr>
           <tr bgcolor="#E5E5D1"> 
            <td width="204" height="27"> 
             <input type="submit" name="_2_submit" value="Send enquiry">
            </td>
            <td width="216" height="27"> </td>
           </tr>
          </table>
         </form>
All the field names in the form begin with _2_, _3_, _4_ or _5_. The meaning of each is as follows

_2_Do not include the contents of this field in e-mail
_3_This is a credit card field
_4_User must fill in this field
_5_This field is optional

And the finished form should look like that shown below....try it, it really works!

Your Name (required)
E-mail (required)
Comments
 


If you need the full source of the form, select "View source" from your browser then cut and save the above code. And that's it!