Mondoze Knowledge Base

Search our articles or browse by category below

How To Use formmail.cgi

Last modified: October 8, 2022
You are here:
Estimated reading time: 1 min

How To Use formmail.cgi

Applies to :

  • All Linux server


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.


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 [email protected], stating your domain name. Alternatively, you can also download it at

  • 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 = ('','');

    … with …

    @referers = ('www.mydomain_name');

    For example, if your web site is at, then the line is…

    @referers = ('');

    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 [email protected], 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 ….

    The part that you should edit is …


    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.


    For example, if the information is supposed to be sent to [email protected], then the line will look like…

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: 46