{"id":415,"date":"2020-06-03T15:46:40","date_gmt":"2020-06-03T07:46:40","guid":{"rendered":"https:\/\/www.wesbytes.com\/guide\/?post_type=kb&#038;p=415"},"modified":"2026-01-08T14:47:25","modified_gmt":"2026-01-08T06:47:25","slug":"how-to-use-formmail-cgi","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/how-to-use-formmail-cgi","title":{"rendered":"How To Use formmail.cgi"},"content":{"rendered":"<h4><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/html.form.guide\/form-mail\/images\/cgi-form-mail-2.jpg\" alt=\"How To Use formmail.cgi\" width=\"289\" height=\"252\" \/><\/h4>\n<h4>How To Use formmail.cgi<\/h4>\n<p><strong>Applies to :<\/strong><\/p>\n<ul>\n<li>All <a href=\"https:\/\/www.servergigabit.com\/linux-vps-hosting\/\">Linux server<\/a><\/li>\n<\/ul>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h2 class=\"mkb-anchor__title\"><strong>Requirements<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<p>To perform this task, you need to have :<\/p>\n<ul>\n<li>Knowledge in accessing the server via\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/connectors\/ftp\/\" rel=\"nofollow noopener\" target=\"_blank\">FTP<\/a>.<\/li>\n<li>IP address or server hostname.<\/li>\n<li>Your server FTP username and password.<\/li>\n<\/ul>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h2 class=\"mkb-anchor__title\"><strong>Instructions<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<\/div>\n<p>formmail.cgi is free script from Matt\u2019s 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\u00a0support@webhosting.com.sg, stating your domain name. Alternatively, you can also download it at\u00a0http:\/\/www.scriptarchive.com\/formmail.html.<\/p>\n<ul>\n<li>First, you must configure formmail.cgi to work for you.<\/li>\n<li>Download formmail.cgi to your local hard disk.<\/li>\n<li>Use a text editor to open formmail.cgi to be edited.Replace the line \u2026\n<pre>@referers = ('worldwidemart.com','209.196.21.3');<\/pre>\n<p>\u2026 with \u2026<\/p>\n<pre>@referers = ('www.mydomain_name');<\/pre>\n<p>For example, if your web site is at\u00a0http:\/\/www.my-company-name.com, then the line is\u2026<\/p>\n<pre>@referers = ('www.my-company-name.com');<\/pre>\n<p>Replace the line \u2026<\/p>\n<pre>@recipients = &amp;fill_recipients(@referers);<\/pre>\n<p>\u2026 with \u2026.<\/p>\n<pre>@recipients = ('^yourself\\@yourdomain\\.com');<\/pre>\n<p>For example, if formmail.cgi is suppose to send information to the email address\u00a0my_name@my-company-name.com, then the line is\u2026<\/p>\n<pre>@recipients = ('^my_name\\@my-company-name\\.com');<\/pre>\n<\/li>\n<li>Save the changes, and upload formmail.cgi to your web site.<\/li>\n<li>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 \u2026.\n<pre> &lt;form name=\"feedback_form\" action=\".\/cgi-bin\/formmail.cgi\" method=\"post\"&gt;<\/pre>\n<p>The part that you should edit is \u2026<\/p>\n<pre>action=\".\/cgi-bin\/formmail.cgi\"<\/pre>\n<p>The \u201caction\u201d part should point to your formmail.cgi with respect to the location of your form. Your form should include the \u201crecipients\u201d field.<\/p>\n<p>Your form should include this line within the open and close tags of the form.<\/p>\n<pre> &lt;input name=\"recipient\" value=\"me@mydomain.com\" type=\"hidden\"&gt;<\/pre>\n<p>For example, if the information is supposed to be sent to\u00a0my_name@my-company-name.com, then the line will look like\u2026<\/p>\n<pre>&lt;input name=\"recipient\" value=\"my_name@my-company-name.com\" type=\"hidden\"&gt;<\/pre>\n<\/li>\n<\/ul>\n<p>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.)<\/p>\n<p>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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How To Use formmail.cgi Applies to : All Linux server Requirements &nbsp; To perform this task, you need to have : Knowledge in accessing the server via\u00a0FTP. IP address or server hostname. Your server FTP username and password. Instructions &nbsp; formmail.cgi is free script from Matt\u2019s Script Archive, Inc. If you post information to formmail.cgi, it will send the information&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[15],"kbtag":[1657],"class_list":["post-415","kb","type-kb","status-publish","hentry","kbtopic-hosting-website-scripts","kbtag-formmail-cgi"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=415"}],"version-history":[{"count":3,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/415\/revisions"}],"predecessor-version":[{"id":5386,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/415\/revisions\/5386"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=415"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=415"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}