Server Gigabit Guide

How To Use formmail.cgi

You are here:
Estimated reading time: 1 min

How To Use formmail.cgi

Applies to :

  • All Linux server

Requirements

 

To perform this task, you need to have :

  • Knowledge in accessing the server via FTP.
  • IP address or server hostname.
  • Your server FTP username and password.

Instructions

 

formmail.cgi is free script from Matt’s Script Archive, Inc. If you post information to formmail.cgi, it will send the information to a specified email address. Please note that formmail.cgi is available only upon request. If you would like to have a copy, please send your request to support@webhosting.com.sg, stating your domain name. Alternatively, you can also download it at http://www.scriptarchive.com/formmail.html.

  • First, you must configure formmail.cgi to work for you.
  • Download formmail.cgi to your local hard disk.
  • Use a text editor to open formmail.cgi to be edited.Replace the line …
    @referers = ('worldwidemart.com','209.196.21.3');

    … with …

    @referers = ('www.mydomain_name');

    For example, if your web site is at http://www.my-company-name.com, then the line is…

    @referers = ('www.my-company-name.com');

    Replace the line …

    @recipients = &fill_recipients(@referers);

    … with ….

    @recipients = ('^yourself\@yourdomain\.com');

    For example, if formmail.cgi is suppose to send information to the email address my_name@my-company-name.com, then the line is…

    @recipients = ('^my_name\@my-company-name\.com');
  • Save the changes, and upload formmail.cgi to your web site.
  • Now that you have configured your formmail.cgi, the next step is to configure your form.Your form must post to formmail.cgi. This is done by editing the form tag.An example is ….
     <form name="feedback_form" action="./cgi-bin/formmail.cgi" method="post">

    The part that you should edit is …

    action="./cgi-bin/formmail.cgi"

    The “action” part should point to your formmail.cgi with respect to the location of your form. Your form should include the “recipients” field.

    Your form should include this line within the open and close tags of the form.

     <input name="recipient" value="me@mydomain.com" type="hidden">

    For example, if the information is supposed to be sent to my_name@my-company-name.com, then the line will look like…

    <input name="recipient" value="my_name@my-company-name.com" type="hidden">

If these 2 things are done correctly, should work on the whole. There are many other configurations available. Please read the README file for more details. (You can download the README file to your local hard disk, then use a text editor to open the README file.)

Please remember to upload your configured back to the server in ASCII mode, and the set the permissions of formmail.cgi as follows: User: read, write, execute; Group: read, execute; Others: read, execute.

Was this article helpful?
Dislike 0
Views: 44