MegaWeb Internet Services
Fri, 21 Nov 2008 01:37
Solutions
Business@Home
MegaWeb Services

HostingFax to Email & Email to FaxConnectivityDomain AdministrationVOIPNetworkingWeb Design & Development

Hosting » Hosting Services » Customer Zone » Scripts » Form Mail

Implementing the formail script
FormMail is a generic WWW form to e-mail gateway, which will parse the results of any form and send them to the specified user. This script has many formatting and operational options, most of which can be specified through the form, meaning you don't need any programming knowledge or multiple scripts for multiple forms. This also makes FormMail the perfect system-wide solution for allowing users form-based user feedback capabilities without the risks of allowing freedom of CGI access.
  1. Create a form that you would like the contents mailed to some address. The form should include the following field (at the very least):
     
    • recipient = specifies who mail is sent to

    Other optional fields can also be used to enhance the operation of FormMail for you site, for example:

    Several other fields are supported, please see the README document for a complete presentation of the supported fields.

    For example, the HTML source for your form may look like this:
    All variables are in RED and must be replaced with your entries

    <form method="POST" action="cgi-bin/mailer/formmail.pl">
    <input type="hidden" name="recipient" value="email@yourdomain">
    <input type="hidden" name="subject" value="Order Request">
    <input type="hidden" name="required" value="realname,username,phone">
    
    Please Enter Your Name:<br>
    <input name="realname" size="40">
    <br>
    Please Enter Your Email Address:<br>
    <input name="username" size="40">
    <br>
    Please Enter Your Phone Number:<br>
    <input name="phone" size="40">
    <br>
    Add Additional Fields Here
    <input type="submit" value="Submit">
    <input type="reset" value="Reset">
    </form>
    This is what your output would be (this example form will do nothing)

    Please Enter your name

    Please Enter Your Email Address:

    Please Enter Your Phone Number:

    • subject = specify the subject included in e-mail sent back to you
    • email = allow the user to specify a return e-mail address
    • realname = allow the user to input their real name
    • redirect = URL of page to redirect to instead of echoing form input
    • required = list of field names that are required input (comma delimited)
Copyright©1996 - 2008 MegaWeb Internet Services | Conditions of use | ProATIA Manual | Your Privacy | Site queries Contact: The Webmaster
MegaWeb is a member of the Internet Service Providers Association and conforms with the code of conduct which can be found at http://www.ispa.org.za/code
Domain Registered through names.co.za | Hosting by Hostmaster | For low cost hosting HostNET is your answer | Design and Development by WebFX