{"id":965,"date":"2011-09-02T15:38:54","date_gmt":"2011-09-02T15:38:54","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2011\/09\/02\/creating-a-contact-form-with-formmail\/"},"modified":"2021-08-16T23:52:09","modified_gmt":"2021-08-17T03:52:09","slug":"creating-a-contact-form-with-formmail","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/","title":{"rendered":"Creating a Contact Form with FormMail"},"content":{"rendered":"<p>FormMail is a very popular script that you can put onto your website so that visitors can fill it out and have their response emailed directly to you. To help you set up FormMail on your website we have written a step-by-step guide to installing and configuring FormMail: If you missed our previous article, please see the <a title=\"Click here to view the previous article\" href=\"\/support\/website\/how-contact-forms-work\/\" target=\"_blank\" rel=\"noopener noreferrer\">How Contact Forms Work<\/a> tutorial.<\/p>\n<ol class=\"article_list\">\n<li>Download the &#8220;<strong>compat<\/strong>&#8221; version of the\u00a0<a href=\"http:\/\/nms-cgi.sourceforge.net\/scripts.shtml\" target=\"_blank\" rel=\"noopener noreferrer\">NMS FormMail<\/a> script.\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>Un-zip the downloaded file and upload the <em>FormMail.pl<\/em> script to your cgi-bin folder in your public_html folder.\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>Next you will need to modify the <em>FormMail.pl<\/em> file that was uploaded into your cgi-bin folder. First, you will need to change the <em>@referers<\/em> line (around line 47). Replace everything inside of the parentheses with your domain using the same formatting, once without the www and then a single space and again with the www.\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>This is where you input any email addresses that the forms will send to. Make sure you remove localhost from both the <em>@referers<\/em> and the <em>@allow_mail_to<\/em> lines (around lines 47 and 48, respectively.) Once you have made these two changes, save the file.\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>After adding the code to the page that you want the form on, you will need to point the action of the FORM tag to the <em>FormMail.pl<\/em> script inside the cgi-bin folder:\n<pre class=\"code_block\"> &lt;form action=\"https:\/\/www.example.com\/cgi-bin\/FormMail.pl\" method=\"post\"&gt;<\/pre>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>Next, inside of each of your forms you will need to include a few hidden input tags. They are detailed below:<\/li>\n<\/ol>\n<pre class=\"code_block\"> &lt;input type=\"hidden\" name=\"recipient\" value=\"you@your.domain,me@your.domain\" \/&gt;<\/pre>\n<p>This tag tells the form which email address to send the form to. Just make sure that this email is one of the addresses in your <em>@allow_mail_to<\/em> field<\/p>\n<pre class=\"code_block\"> &lt;input type=\"hidden\" name=\"subject\" value=\"From the feedback form\" \/&gt;<\/pre>\n<p>This is a optional tag you can input into your form to specify the subject line of the email that gets delivered to you.<\/p>\n<pre class=\"code_block\"> &lt;input type=\"hidden\" name=\"redirect\" value=\"https:\/\/www.your.domain\/foo.html\" \/&gt;<\/pre>\n<p>This is another optional tag to specify where your users will be redirected to after they click the submit button.<\/p>\n<div style=\"clear: both;\"><\/div>\n<p>Finally in order for FormMail to work you must set the permissions on the <em>FormMail.pl<\/em> to <strong>755<\/strong>.\u00a0 This can be completed within your File Manager as well by right clicking on the file and selecting &#8220;change permissions.&#8221; For more information on this course please visit <a title=\"Click here to view the courses\" href=\"\/support\/server\/databases\/mysql-1044-access-denied-error-message\/\" target=\"_blank\" rel=\"noopener noreferrer\">Adding Contact Forms<\/a>.<\/p>\n<div class=\"alert alert-info\">\n<h2>Updates for Shared Servers<\/h2>\n<p>If you are creating a form on a shared server (business class account), then all form feedback will automatically be set to come from &#8220;nobody&#8221;. This was done in order to be able to add an email origin for emails coming from scripts on shared servers. The main purpose for this setting was to help stop spam. Previously, messages generated from scripts were difficult to track. Setting the form to use the email systems on the server helps to reduce load on the server.<\/p>\n<p>You can set the form to use SMTP by looking for the following line in the <i><b>FormMail.pl<\/b><\/i> script:<\/p>\n<p class=\"code_block\">$mailprog = &#8216;\/usr\/lib\/sendmail -oi -t&#8217;;<\/p>\n<p>Then, you would replace it with:<\/p>\n<p class=\"code_block\">$mailprog = &#8216;SMTP:mail.DomainName.com&#8217;;<\/p>\n<p>If you require help finding your email server settings, please see <a href=\"\/support\/email\/how-to-find-email-settings\/\">&#8220;How to Find Email Settings.&#8221;<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>FormMail is a very popular script that you can put onto your website so that visitors can fill it out and have their response emailed directly to you. To help you set up FormMail on your website we have written a step-by-step guide to installing and configuring FormMail: If you missed our previous article, please<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\"> Read More ><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-965","post","type-post","status-publish","format-standard","hentry","category-email"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating a Contact Form with FormMail | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this tutorial learn how to properly set up FormMail\" \/>\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.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a Contact Form with FormMail | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this tutorial learn how to properly set up FormMail\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2011-09-02T15:38:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:52:09+00:00\" \/>\n<meta name=\"author\" content=\"Brad Markle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad Markle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\"},\"author\":{\"name\":\"Brad Markle\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\"},\"headline\":\"Creating a Contact Form with FormMail\",\"datePublished\":\"2011-09-02T15:38:54+00:00\",\"dateModified\":\"2021-08-17T03:52:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\"},\"wordCount\":510,\"commentCount\":69,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Email\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\",\"name\":\"Creating a Contact Form with FormMail | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2011-09-02T15:38:54+00:00\",\"dateModified\":\"2021-08-17T03:52:09+00:00\",\"description\":\"In this tutorial learn how to properly set up FormMail\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a Contact Form with FormMail\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\",\"name\":\"Brad Markle\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a Contact Form with FormMail | InMotion Hosting","description":"In this tutorial learn how to properly set up FormMail","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.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/","og_locale":"en_US","og_type":"article","og_title":"Creating a Contact Form with FormMail | InMotion Hosting","og_description":"In this tutorial learn how to properly set up FormMail","og_url":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2011-09-02T15:38:54+00:00","article_modified_time":"2021-08-17T03:52:09+00:00","author":"Brad Markle","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Brad Markle","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/"},"author":{"name":"Brad Markle","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf"},"headline":"Creating a Contact Form with FormMail","datePublished":"2011-09-02T15:38:54+00:00","dateModified":"2021-08-17T03:52:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/"},"wordCount":510,"commentCount":69,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Email"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/","url":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/","name":"Creating a Contact Form with FormMail | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2011-09-02T15:38:54+00:00","dateModified":"2021-08-17T03:52:09+00:00","description":"In this tutorial learn how to properly set up FormMail","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/email\/creating-a-contact-form-with-formmail\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Creating a Contact Form with FormMail"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf","name":"Brad Markle","url":"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=965"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/965\/revisions"}],"predecessor-version":[{"id":86593,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/965\/revisions\/86593"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}