Here is a walk through on setting up the NMS FormMail script. ou will need to
Steps for setting up FormMail using NMS FormMail script (formmail.cgi):
- Download the NMS FormMail script. Make sure to download the "compat" version.
- Un-compress the downloaded file to your computer.
- Open the FormMail.pl (or formmail.cgi) file with Notepad. (NOTE: Don't use MS Word as that will alter the formating and break the script code)
- and upload the FormMail.pl (or formmail.cgi) script to your cgi-bin directory.
- Under the "USER CONFIGURATION SECTION", we will need to change a few variables for the script to work properly.
- The first variable we need to change is the @referers variable. 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 like so: (Replace the part highlighted in yellow)
@referers = qw(mydomain.com www.mydomain.com my-otherdomain.com www.my-otherdomain.com); - The second variable we need to change is the @allow_mail_to variable. Enter a valid email address that the forms will send to. Again, only one space between multiple email addresses. Also, make sure you remove 'localhost' from both the @referers and the@allow_mail_to lines. Remember, only one space between each url like so: (Replace the part highlighted in yellow)
@allow_mail_to = qw(you@your.domain some.one.else@your.domain); - Once you made the above two changes, save the file and upload it to your website either via a FTP client or through BEZA.NET Control Panel built-in FTP client called Webshell.
- Set permission on the FormMail.pl (or formmail.cgi) to 755 to allow the script to be executed. This can be down via webshell or through a FTP client.
- Next, you need to link the FormMail.pl (or formmail.cgi) to your web form by adding the following html tag to your contact us page. Make sure the action points to the correct location on the web server where the script was uploaded. The following is an example.
<form action="/cgi-bin/formmail/formmail.cgi" method="post" >