{"id":838,"date":"2016-09-08T12:21:25","date_gmt":"2016-09-08T16:21:25","guid":{"rendered":"https:\/\/www.pair.com\/support\/kb\/?p=838"},"modified":"2024-01-12T15:03:50","modified_gmt":"2024-01-12T20:03:50","slug":"using-formmail-pl","status":"publish","type":"ht_kb","link":"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/","title":{"rendered":"How to Use formmail.pl"},"content":{"rendered":"\n<p><span class=\"s1\"><a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/shared-hosting\/\"><p style=\"background-color:#1a3d6e !important;color:#fff;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">Shared<\/p><\/a> <a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/vps\/\"><p style=\"background-color:#1a3d6e !important;color:#fff;padding:6px; display:inline-block!important;font-size:12px;font-weight:bold; border-radius:3px;\">VPS<\/p><\/a> <a style=\"color:#fff; text-decoration:none!important;\" href=\"https:\/\/www.pair.com\/support\/kb\/tags\/qs-dedicated\/\"><p style=\"background-color:#1a3d6e !important;color:#fff;padding:6px; display:inline-block!important;font-size:12px; font-weight:bold; border-radius:3px;\">Dedicated<\/p><\/a><\/span><\/p>\n\n\n    \t\t<div class=\"hts-messages hts-messages--info   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tIf you use WordPress, we recommend using a contact form plugin instead of formmail.pl.    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n\n\n\n<h3 class=\"wp-block-heading\">formmail.pl<\/h3>\n\n\n\n<p>We use a special version of formmail.pl. This version protects against abuse by ensuring the email recipient is legitimate.<\/p>\n\n\n\n<p>Any form fields included in the call to formmail.pl will be included in the email that is sent.<br>formmail.pl has many optional hidden fields, but only the <em>recipient<\/em> field is required since it determines where the email is sent.<\/p>\n\n\n\n<p>formmail.pl accepts form submissions using the POST method. A line of code is required to pass the form input from your page to formmail.pl. This code varies based on your hosting account type and the type of CGI used.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">To ensure proper delivery of formmail, you may need to enable SPF on your domain. Some popular email providers, such as Gmail, automatically reject email without SPF enabled.\u00a0<br><br>See\u00a0<a href=\"https:\/\/www.pair.com\/support\/kb\/adding-an-spf-record-to-a-domain\/#turning-on-the-pre-configured-spf-record\" target=\"_blank\" rel=\"noreferrer noopener\">Turning on the Pre-Configured SPF Record<\/a>\u00a0for information about setting up SPF on your domain.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">If you have a Dedicated or VPS account without FastCGI or a Shared Hosting account created before June 1, 2011<\/h4>\n\n\n\n<p>If your account fits into any of the following categories, follow the instructions below:<\/p>\n\n\n\n<ul>\n<li>Shared Hosting accounts created before June 1, 2011<\/li>\n\n\n\n<li>Dedicated accounts not using FastCGI<\/li>\n\n\n\n<li>VPS accounts not using FastCGI<\/li>\n<\/ul>\n\n\n\n<p>If one of these categories describes your account, add this code to your webpage:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;form method=\"post\" action=\"\/cgi-sys\/formmail.pl\"&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">If your account does not fit any categories above...<\/h4>\n\n\n\n<p>If your account does not fit into the categories above, your account will likely fall into one of these categories.<\/p>\n\n\n\n<ul>\n<li>Shared Hosting accounts created after June 1, 2011<\/li>\n\n\n\n<li>Dedicated accounts using FastCGI<\/li>\n\n\n\n<li>VPS accounts using FastCGI<\/li>\n\n\n\n<li>Any account with cgi-sys disabled<\/li>\n\n\n\n<li>Domains using suEXEC or php-cgiwrap<\/li>\n<\/ul>\n\n\n\n<p>If so, follow the instructions below:<\/p>\n\n\n\n<ol>\n<li>Copy the formmail.pl script from the <em>\/usr\/www\/cgi-bin\/<\/em> directory into your domain's cgi-bin folder.<\/li>\n\n\n\n<li>Once you have done this, add this line of code to your webpage:\n<pre class=\"prettyprint\">&lt;form method=\"post\" action=\"\/cgi-bin\/formmail.pl\"&gt;<\/pre>\n<p><\/p><\/li>\n<\/ol>\n\n\n    \t\t<div class=\"hts-messages hts-messages--alert   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tNot sure what category your account falls into? You can <a href=\"mailto:support@pair.com\">contact our 24\/7 support for help<\/a>!    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n\n\n\n<p>There are no modifications needed to this line in your code.<br>Unless you are running suEXEC as well, you should not copy the formmail.pl file to your account's cgi-bin unless you intend on customizing the source code of it. The \"<span style=\"font-family: monospace;\">cgi-bin\"<\/span> portion of the action above directs the server to look into the server's cgi-bin so the formmail.pl script doesn't need to reside in your individual account.<\/p>\n\n\n\n<li><span style=\"font-weight: 400;\">Create a file named \"<\/span><i><span style=\"font-weight: 400;\">.formmail\"<\/span><\/i><span style=\"font-weight: 400;\"> in your account's home directory (<\/span><i><span style=\"font-weight: 400;\">\/<\/span><\/i><span style=\"font-weight: 400;\">usr<\/span><i><span style=\"font-weight: 400;\">\/home\/USERNAME<\/span><\/i><span style=\"font-weight: 400;\">). Add all form recipient email addresses into this file. This will prevent the form from being abused to send to arbitrary addresses.<\/span><\/li>\n\n\n\n<h3 class=\"wp-block-heading\">formmail.pl Example<\/h3>\n\n\n\n<p>In the following example, only the <em>recipient<\/em> field is required. This field specifies the destination email address for the form contents.<\/p>\n\n\n\n<p><strong>Example<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;input type=\"hidden\" name=\"recipient\" value=\"address@example.com\"&gt;<\/pre>\n\n\n\n<p>If you wish to have multiple recipient email addresses, then separate each email address with a comma in the value section of this field.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">For the following:<br>   - Shared hosting accounts created after June 2011 <br>   - Email addresses not hosted on Pair servers <br><br>You will need to create a file named .formmail and place it into your account home directory (\/usr\/home\/USERNAME). This prevents the form from being abused to send to arbitrary addresses.<\/p>\n\n\n\n<p>If the form's recipient address is not hosted by Pair Networks, you will receive the following error message. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Error: Bad Recipient<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">formmail.pl Fields<\/h3>\n\n\n\n<p>Here are other fields you can use with formmail.pl.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><b>subject<\/b><\/td><td>\n<p>This field specifies the Subject line of the outgoing email. If not given<span style=\"font-weight: 400;\">, the default Subject is \"WWW Form Submission.\"<\/span><\/p>\n<\/td><\/tr><tr><td><b>email<\/b><\/td><td> <p>This hidden field specifies the return email address. It is recommended that this email address matches the domain the form is hosted on.\u00a0Example: no-reply@domain.com<br>If not supplied, the default is nobody@pair.com.\u00a0<br>\u00a0<br>Note: Popular email providers, like Gmail, are enforcing SPF checks on incoming email. It is recommended to enable SPF on your domain. See\u00a0<a href=\"https:\/\/www.pair.com\/support\/kb\/adding-an-spf-record-to-a-domain\/#turning-on-the-pre-configured-spf-record\" target=\"_blank\" rel=\"noreferrer noopener\">Turning on the Pre-Configured SPF Record<\/a>\u00a0for more information.<span style=\"font-family: inherit; font-size: inherit; color: rgb(0, 0, 0);\"> <\/span><\/p><\/td><\/tr><tr><td><b>realname<\/b><\/td><td>\n<p><span style=\"font-weight: 400;\">This field specifies the real name of the user submitting the form.<\/span> If supplied, this should be a field filled in by the user. The email will<span style=\"font-weight: 400;\"> be generated with this name in the headers.<\/span><\/p>\n<\/td><\/tr><tr><td><b>redirect<\/b><\/td><td>\n<p><span style=\"font-weight: 400;\">This field specifies the URL to which the user should be automatically <\/span><span style=\"font-weight: 400;\">redirected after successful delivery of the form. It must be a full URL; relative links will not work. If this field is not specified, a default response will be generated by the script.<\/span><\/p>\n<\/td><\/tr><tr><td><b>required<\/b><\/td><td>\n<p>This field allows you to specify that certain fields (in a comma separated list) in the form are \"required.\" This means that these fields may not be empty when the form is submitted. If any of the specified fields are empty, the user will receive<span style=\"font-weight: 400;\"> a warning, and the form will not be submitted.<\/span><\/p>\n<\/td><\/tr><tr><td><b>title<\/b><\/td><td>\n<p><span style=\"font-weight: 400;\">This field specifies the title for the default response page that is <\/span><span style=\"font-weight: 400;\">generated by the script in absence of a <\/span><i><span style=\"font-weight: 400;\">redirect<\/span><\/i><span style=\"font-weight: 400;\"> field. The default is \"Thank You.\"<\/span><\/p>\n<\/td><\/tr><tr><td><b>return_link_url<\/b><\/td><td>\n<p><span style=\"font-weight: 400;\">This field specifies a URL that will appear on the default response <\/span><span style=\"font-weight: 400;\">page that is generated by the script in absence of a <\/span>redirect field<span style=\"font-weight: 400;\">. This URL can be used to allow users to return to, for example,<\/span><span style=\"font-weight: 400;\"> your homepage.<\/span><\/p>\n<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>formmail.pl We use a special version of formmail.pl. This version protects against abuse by ensuring the email recipient is legitimate. Any form fields included in the call to formmail.pl will be included in the email that is sent.formmail.pl has many optional hidden fields, but only the recipient field is required&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[175],"ht-kb-tag":[178,176,177],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use formmail.pl - Knowledge Base - Pair Networks<\/title>\n<meta name=\"description\" content=\"formmail.pl is a web form delivery script that can be used with any account level at Pair Networks. We are using a special version of formmail.pl modified to protect against abuse by ensuring that the email recipient is legitimate.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use formmail.pl - Knowledge Base - Pair Networks\" \/>\n<meta property=\"og:description\" content=\"formmail.pl is a web form delivery script that can be used with any account level at Pair Networks. We are using a special version of formmail.pl modified to protect against abuse by ensuring that the email recipient is legitimate.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - Pair Networks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pairnetworks\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-12T20:03:50+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@pairNetworks\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/\",\"name\":\"How to Use formmail.pl - Knowledge Base - Pair Networks\",\"isPartOf\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#website\"},\"datePublished\":\"2016-09-08T16:21:25+00:00\",\"dateModified\":\"2024-01-12T20:03:50+00:00\",\"description\":\"formmail.pl is a web form delivery script that can be used with any account level at Pair Networks. We are using a special version of formmail.pl modified to protect against abuse by ensuring that the email recipient is legitimate.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pair.com\/support\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use formmail.pl\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#website\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/\",\"name\":\"Knowledge Base - Pair Networks\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pair.com\/support\/kb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#organization\",\"name\":\"Pair Networks\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg\",\"contentUrl\":\"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg\",\"width\":360,\"height\":360,\"caption\":\"Pair Networks\"},\"image\":{\"@id\":\"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pairnetworks\/\",\"https:\/\/twitter.com\/pairNetworks\",\"https:\/\/www.instagram.com\/pairnetworks\/\",\"https:\/\/www.linkedin.com\/company\/2269676\/\",\"https:\/\/www.pinterest.com\/pairnetworksinc\/pins\/\",\"https:\/\/www.youtube.com\/user\/pairnetworks\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use formmail.pl - Knowledge Base - Pair Networks","description":"formmail.pl is a web form delivery script that can be used with any account level at Pair Networks. We are using a special version of formmail.pl modified to protect against abuse by ensuring that the email recipient is legitimate.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/","og_locale":"en_US","og_type":"article","og_title":"How to Use formmail.pl - Knowledge Base - Pair Networks","og_description":"formmail.pl is a web form delivery script that can be used with any account level at Pair Networks. We are using a special version of formmail.pl modified to protect against abuse by ensuring that the email recipient is legitimate.","og_url":"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/","og_site_name":"Knowledge Base - Pair Networks","article_publisher":"https:\/\/www.facebook.com\/pairnetworks\/","article_modified_time":"2024-01-12T20:03:50+00:00","twitter_card":"summary_large_image","twitter_site":"@pairNetworks","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/","url":"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/","name":"How to Use formmail.pl - Knowledge Base - Pair Networks","isPartOf":{"@id":"https:\/\/www.pair.com\/support\/kb\/#website"},"datePublished":"2016-09-08T16:21:25+00:00","dateModified":"2024-01-12T20:03:50+00:00","description":"formmail.pl is a web form delivery script that can be used with any account level at Pair Networks. We are using a special version of formmail.pl modified to protect against abuse by ensuring that the email recipient is legitimate.","breadcrumb":{"@id":"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pair.com\/support\/kb\/using-formmail-pl\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pair.com\/support\/kb\/"},{"@type":"ListItem","position":2,"name":"How to Use formmail.pl"}]},{"@type":"WebSite","@id":"https:\/\/www.pair.com\/support\/kb\/#website","url":"https:\/\/www.pair.com\/support\/kb\/","name":"Knowledge Base - Pair Networks","description":"","publisher":{"@id":"https:\/\/www.pair.com\/support\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pair.com\/support\/kb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pair.com\/support\/kb\/#organization","name":"Pair Networks","url":"https:\/\/www.pair.com\/support\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg","contentUrl":"https:\/\/www.pair.com\/support\/kb\/wp-content\/uploads\/2022\/02\/Gb_TUkUE_400x400.jpeg","width":360,"height":360,"caption":"Pair Networks"},"image":{"@id":"https:\/\/www.pair.com\/support\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pairnetworks\/","https:\/\/twitter.com\/pairNetworks","https:\/\/www.instagram.com\/pairnetworks\/","https:\/\/www.linkedin.com\/company\/2269676\/","https:\/\/www.pinterest.com\/pairnetworksinc\/pins\/","https:\/\/www.youtube.com\/user\/pairnetworks"]}]}},"_links":{"self":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/838"}],"collection":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/comments?post=838"}],"version-history":[{"count":34,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/838\/revisions"}],"predecessor-version":[{"id":9584,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb\/838\/revisions\/9584"}],"wp:attachment":[{"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/media?parent=838"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=838"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.pair.com\/support\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}