FormMail is a popular script that you can use with your website so that visitors can fill it out and have their response emailed directly to you. This is not the only method to set up FormMail but is generally considered the most straight forward.  To help you set up FormMail on your website, we have outlined the steps to install and set up FormMail:

Creating a Contact Form with FormMail

  1. Download the "compat" version of the NMS FormMail script.

  2. Un-zip the downloaded file and upload the FormMail.pl script to your cgi-bin folder in your public_html folder.

  3. Next you will need to modify the FormMail.pl file that was uploaded into your cgi-bin folder. Open the file for editing using either Edit or Code Editor in the cPanel File Manager.

    edit-FormMail

  4. First, you will need to change the @referers line. Replace everything inside of the parentheses with your domain name, once without the www followed by a single space and again with the www.

  5. @referers          = qw(yourdomain.com www.yourdomain.com);

  6. Next, edit the @allow_mail_to line and replace the existing information with any email addresses that you want the completed form information sent to. If you will be sending a form to multiple recipients or allowing users to choose different recipients, make sure you add each email address with a single space between them.

  7. @allow_mail_to       = qw( This email address is being protected from spambots. You need JavaScript enabled to view it. This email address is being protected from spambots. You need JavaScript enabled to view it. );

    Make sure you remove localhost from both the @referers and the @allow_mail_to lines.

    After making these two changes, save and close the file.

  8. Once you have created your contact form, you will need to point the action of the FORM tag to the FormMail.pl script inside the cgi-bin folder:

  9. <form action="http://www.yourdomain.com/cgi-bin/FormMail.pl" method="post">

  10. You will also need to include a hidden input tag to tell the form which email address to send to.

  11. <input type="hidden" name="recipient" value=" This email address is being protected from spambots. You need JavaScript enabled to view it. , This email address is being protected from spambots. You need JavaScript enabled to view it. " / >

    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 the @allow_mail_to line in FormMail.pl

  12. There are also two optional tags you can include in your form to specify the subject line of the email that gets delivered to you and what page (URL) users will be redirected to once they have submitted the form: 

  13. Specify Email Subject Line:

    <input type="hidden" name="subject" value="From the feedback form" / >

    You can edit the subject as you like so you can easily recognize emails received from your contact form

    Redirect after form submission:

    <input type="hidden" name="redirect" value="http://www.yourdomain.com/thankyou.html" / >

    Please note in the example above, you will need to create the thankyou.html file. You can also name this file differently (thanks.html for example). Just make sure that name of the file you create matches the name of the file referenced in the tag (e.g. value="http://www.yourdomain.com/thanks.html" / >. This tag is completely optional, if you do not include this tag, users will instead be redirected to the default FormMail Thank You page:

    formmail-default-thank-you

  14. Finally in order for FormMail to work, make sure the permissions on the FormMail.pl file are set to 755. If this needs to be changed; in the File Manager, right click on the file and select "change permissions."
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Comments

n/a Points
2014-09-15 5:05 pm
You can't...I have it bookmarked. Thanks!

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}