New Formmail.pl Walkthrough

Discuss forms and the best CGIs for handling visitors info from your web site

Moderators: Chuck, Ilbin, Vanessa

New Formmail.pl Walkthrough

Postby brandonf on Wed Aug 29, 2007 2:30 pm

Here is a walkthrough on setting up the NMS FormMail script.

See Also: Preventing SPAM in FormMail

You will need to download the NMS FormMail script. Make sure to download the "compat" version.

1) Un-compress the downloaded file and upload the FormMail.pl script to your cgi-bin (you will only need to upload the FormMail.pl file, all other files are documentation).

2) The next step is to modify the FormMail.pl that is inside your cgi-bin. There are only two lines that you will need to modify. The first is the @referrers line. Replace everything inside of the parentheses with your domain, once without the www and then a single space and again with the www. You will need to do this for each domain that you will be sending from. Remember, only one space between each url.

3) Next you will want to modify the next line down, the @allow_mail_to line. This is where you input any email addresses that the forms will send to. Again, only one space between multiple email addresses. Also, make sure you remove localhost from both the @referrers and the @allow_mail_to lines.

4) Now you can save the FormMail and proceed to modifying your forms.

5) First, point the action of the FORM tag to the FormMail.pl script inside the cgi-bin.

Code: Select all
<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:

Code: Select all
<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

Code: Select all
<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.

Code: Select all
<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. If you do not include this they will be directed to a very generic looking page created by the FormMail script.

7) One last thing that must be performed in order for the FormMail to work is that you must set the permissions on the FormMail.pl to 755. This can be done either inside our control panel from the file manager or from an FTP client like SmartFTP or WS_FTP.

If you are using the file manger you will want to browse to the cgi-bin by clicking on the folder icons for public_html > cgi-bin. Once inside of the cgi-bin click on the text title for FormMail.pl and take notice of the text links that appear in the upper right hand corner of the screen. One of them is Change Permissions. Click this and click all the check boxes for Execute. This will change the numbers at the bottom to 755. Click Change, and your all done.

If you are using an FTP client you will want to browse to the cgi-bin. Then right click on the FormMail.pl and look for an option called CHMOD. This will open a dialog box where you can make the same changes as in our file manager. Make sure execute is turned on for all types of users and that the numbers have changed to 755.

If you have any questions on how to set this up please feel free to send an email to support@inmotionhosting.com.
InMotion Hosting, Inc.
brandonf
InMotion Staff
 
Posts: 1
Joined: Wed Aug 29, 2007 12:34 pm

Will this mailform work with PHP script?

Postby Skywalker on Sat Dec 29, 2007 12:32 am

Hi,

I am running a PHP script social network web site. Will this CGI mail form work or I need a PHP mailform? Thanks.

Skywalker
Skywalker
Forum User
 
Posts: 22
Joined: Mon Oct 15, 2007 8:50 pm

Re: New Formmail.pl Walkthrough

Postby Ray1 on Sun Jun 21, 2009 9:23 pm

thanks for sharing info. Keep sharing such good stuff.It really helps... :)
Ray...
Ray1
Forum User
 
Posts: 1
Joined: Tue Jun 16, 2009 4:09 am


Return to Creating and Using Forms

Who is online

Users browsing this forum: No registered users and 0 guests