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 wrote a ste-by-step guide to installing and configuring FormMail: If you missed our previous article, please see the How Contact Forms Work tutorial.

  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. First, you will need to change the @referers 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.
  4. This is where you input any email addresses that the forms will send to. Make sure you remove localhost from both the @referers and the @allow_mail_to lines (around lines 47 and 48, respectively.) Once you have made these two changes, save the file.
  5. 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 FormMail.pl script inside the cgi-bin folder:
    <form action="http://www.yourdomain.com/cgi-bin/FormMail.pl" method="post">
    
  6. Next, inside of each of your forms you will need to include a few hidden input tags. They are detailed below:

    <input type="hidden" name="recipient" value="you@your.domain,me@your.domain" />
    

    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 @allow_mail_to field

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

    This is a optional tag you can input into your form to specify the subject line of the email that gets delivered to you.

    <input type="hidden" name="redirect" value="http://www.your.domain/foo.html" />
    

    This is another optional tag to specify where your users will be redirected to after they click the submit button.

  7. Finally in order for FormMail to work you must set the permissions on the FormMail.pl to 755.  This can be completed within your File Manager as well by right clicking on the file and selecting "change permissions." For more information on this course please visit Adding Contact Forms.
Continued Education in Course 202: Adding Contact Forms
You are viewing Section 3: Creating a Contact Form with FormMail
Section 2: How Contact Forms Work
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!

Related Questions

Here are a few questions related to this article that our customers have asked:
Datepicker or equivelant and FormMail
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-07-30 10:25 am
I am still learning the system. Just under too much pressure to read slowly and understand.
Staff
9,037 Points
2014-08-11 4:19 pm
Hello Gerard,

Thank you for contacting us. We are happy to help you setup your FormMail, is there a step you are having trouble with?

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-08-15 6:17 am

Hi John,

 

I would like to try this to our company website but I don't understand well how to follow the instructions correctly.

Maybe it can help if you put also the certain line in #3 and #4 instructions to go to, to make it easier.

Thanks!

Armand

 

Staff
9,037 Points
2014-08-15 9:11 am
Hello Armand,

Thank you for your suggestion. I have created a ticket for our Support Center team, and we will be reviewing the article.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-09-15 6:53 pm

I'm fine until step 5, I have no idea where to add the code to. This is the first time I've been into the cPanel and really feel confused now. I'd really like to understand this a bit better. I've been trying to research this for about a week and just found your site. Thank you

Staff
16,820 Points
2014-09-15 7:17 pm
Hello Patricia,

Sorry that you're feeling confused. Websites are basically files on a server. In order to obtain the data for email that you want to automatically send, you need a web page that is referencing the form. The CGI-BIN is a folder on your server - this is where the script that you obtained from the zip file will need to be saved. You can use the cPanel File manager for an easy way to manipulate files on your server.

If you need more detailed help with creating the form on your website, follow these tutorials and they'll help you understand that portion of it: Adding Contact Forms to your website.

Hope that helps! If you have any further questions please let us know.

Regards,
Arnel C.
n/a Points
2014-09-15 8:55 pm

Thanks for such a quick response, that was awesome! I'm confused as to where exactly I'm to put steps 5 and 6 of the Creating a Contact Form with FormMail tut. Does it go in the Perl doc or in my Dreamweaver Contact page, where I created the html. Does it go in the head or body? Thanks again.

 

Staff
16,820 Points
2014-09-15 9:21 pm
Hello Patricia,

The code goes into your web page - where ever your form code located. The PERL script changes are edited directly in the PL file that saved in your CGI-BIN folder. The web page is where ever you're displaying the form where your visitors have to click and fill out the fields in order for the form mail to be sent. If you're still confused, please let me know.


Regards,
Arnel Cl
n/a Points
2014-09-28 4:29 pm

I have 2 problems I'm trying to fix.

1) I got the form to work but under the subject line it says "Below is the result of your feedback form.  It was submitted by () on Sunday, September 28, 2014 at 15:51:16"

Shouldn't the () show the person's name and/or email who submitted it?  It makes no sense for it to be empty.

 

2) the email I get is from "nobody@ecbiz(my server).inmotionhosting.com"  This really looks like spam.  Is there a way to have it come from a name I choose?

I'm not a programmer but if you tell me what to change in the perl script I can do that.

Sorry if this is a duplicate.  The captcha said it didn't work although I thought it did.

Staff
9,037 Points
2014-09-29 11:26 am
Hello liz,

Thank you for your question. 1) I looked through the README file included with the formail script, and it says the From should be pulled from the form. Meaning if they fill out the "from" field, it should be included.

2) We are happy to help, but will need some additional information to answer this section. Is this the email you get when you fill out the form? or is this sent to you notifying you that someone else has filled out the form? Can you provide a link to the form?

Feel free to post any additional questions below.

Thank you,
John-Paul
n/a Points
2014-09-29 12:42 pm

I filled out the form myself and submitted it and this is what I received.

 

Thanks,

Liz

Staff
16,820 Points
2014-09-29 1:51 pm
Hello Liz,

Sorry for the problem. Can you provide some details on what you received? We don't see anything in your reply.

Regards,
Arnel C.
n/a Points
2014-09-29 3:58 pm

Here is the link to my sample form http://www.refugeerelief.org/formtest.html

What I received is:

 

nobody@ecbiz158.inmotionhosting.com

Volunteer Form

Below is the result of your feedback form.  It was submitted by

() on Monday, September 29, 2014 at 15:56:52---------------------------------------------------------------------------name: lizanimal: cat---------------------------------------------------------------------------

Staff
18,772 Points
2014-09-29 5:45 pm
Hello Liz,

I have set up a test form on my own server with the FormMail and have run a few tests. The 'nobody@' email address appears when the email section of the form is left blank. This is the same for the () that appears. This means that the name field was seen to be empty.

When I put information in those fields, I receive the email and it has the content that was inserted in place of the default information (nobody@ and () ).

Kindest Regards,
Scott M
n/a Points
2014-09-29 6:21 pm

i just filled out our real form (not our previous test form)  which has the same action script http://refugeerelief.org/contact.shtml  and I got the same thing

I entered my name in the name field and my email in the email field.  The result is the same.

The email is still coming "nobody@ecbiz158.inmotionhosting.com," the header is still correct which says "volunteer form" but the first line of text still says ays "Below is the result of your feedback form.  It was submitted by () on Monday, September 29, 2014 at 18:16:03"  Underneath that it does give my name and email where I filled out the form fields but I want to change the "from nobody@ecbiz158.inmotionhosting.com" and the "It was submitted by ()"

I don't know why you are getting different results from me.  I am using Apple mail on a desktop computer to receive my mail.

Liz

Staff
16,820 Points
2014-09-29 7:01 pm
Hello Liz,

Sorry about the confusion with the form. Scott and I have both looked at this. I discovered the cause for this as a security setting on shared servers. This security setting basically forces the "nobody@servername.com" to appear when mail is sent without specifying a server and server - this happens with the formmail script. Luckily, you can easily fix this. Here's the section in the FormMail readme file on using SMTP settings (that stop the nobody thing from happening):

If your web server lacks a sendmail binary, you can
use an SMTP relay instead, by setting $mailprog like
this:

$mailprog = 'SMTP:mailhost.your.domain';

You will need to replace mailhost.your.domain with
the name or IP address of an SMTP server configured
to relay mail for the web server.

Your system administrator or hosting provider should
be able to tell you either the path to sendmail on the
web server or the name of a host that will act as an
SMTP relay for the web server.

You can find your OUTBOUND SMTP settings by reviewing this article: How to find my email settings.

Modify your form and then with those settings, then the Sender should be set to the Postmaster setting in your script. If you continue to have problems with it, please let us know.

Sorry again for the headaches with the form. The setting for NOBODY is forced in order to help put a stop to SPAM issues on our servers. Forcing a sender of NOBODY when SMTP settings and sender are not verified allows us to track where the email is coming from and put a stop to illicit spam scripts that are sometimes forced on unaware account owners.

Kindest regards,
Arnel C.
n/a Points
2014-09-29 9:45 pm

Thank you for figuring this out.  Unfortunately, not being a programmer, I am still unclear on what to do. I'm told by tech support that I can't use sendmail and they suggested using a php script.  Regarding your fix for not having sendmail, where exactly do I put $mailprog = 'SMTP:mailhost.your.domain. Somewhere on the FormMail.pl file?

Thanks,Liz

Staff
16,820 Points
2014-09-30 12:24 pm
Hello Liz,

Sorry for the confusion. The Formmail.pl file is a PERL script, but it also a simple text file that you can edit using a text editor such as the one available to you through the cPanel (checkout: Using the File Manager Code Editor).

You would look for this line:

$mailprog = 'SMTP:mailhost.your.domain';

And replace the SMTP:mailhost.your.domain with your SMTP settings. So it would look like this:

$mailprog = 'SMTP:mail.refugeerelief.com';


I hope that helps to clarify it for you! You don't need to be a programmer to make this kind of change. Let us know if you require any further assistance.

Regards,
Arnel C.




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.

18 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

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

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!