| Support Home > Knowledgebase > Docs > FormMail | Sunday, July 20, 2008 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
FormMail - Sending E-mail from a Web FormFormMail is a special script designed to allow you to send e-mails based on the input from an HTML form on your website. Important Security InformationNOTE: Prior to 8 March, 2002, FormMail for the Virtual Private Server used the source from Matt's Script Archive. This version (version 1.91) of FormMail has a number of significant security holes which allow malicious users to relay messages through a vulnerable server.NMS FormMail is a drop-in replacement for the orignal script which overcomes the security problems associated with FormMail. We strongly urge anyone using FormMail to switch to the NMS version if they are not already using it. NMS FormMail was specifically designed to be compatible with the original FormMail script, and should not require you to make any changes to your HTML forms already in use when you switch to the NMS version. Installing NMS FormMailThe following instructions will guide you through the process of installing NMS Hosting account.Back Up your Current FormMailIf you already have a version of FormMail running on your account, you should make a copy of it before installing the NMS FormMail script.Dowload the NMS FormMail script to your local computerClick on the link below to download the NMS FormMail script to your local computer. Save the file to a location where you can easily find it after you have downloaded the file.http://nms-cgi.sourceforge.net/ Unzip and Edit the FormMail.pl fileYou will need to extract the FormMail.pl file from the formmail.zip file. You can do this by opening formmail.zip using WinZip (or some other .zip file extraction program) and right-clicking on FormMail.pl and selecting Extract from the context menu. Select a loction where you can remember and extract the file.Once you have extracted the file, you will need to open it and edit some values. Open the file using NotePad or your favorite text editor. Scroll down to the User Configuration Section and find the following line. $mailprog = '/usr/lib/sendmail -oi -t';Change the path to use /usr/sbin/sendmail instead of /usr/lib/sendmail. The line should now look like this: $mailprog = '/usr/sbin/sendmail -oi -t';Next, you need to edit the domain names allowed to use the form. Find the following line in the script (it should be just a few lines down): @referers = qw(dave.org.uk 209.207.222.64 localhost);Remove dave.org.uk and 209.207.222.64 and put your Hosting Account domain name in. For example, if your domain name were MY-DOMAIN.NAME, the line should look like this when you are done: @referers = qw(MY-DOMAIN.NAME localhost);You will also need to change the allowed recipients. The next line in the FormMail.pl script looks like this: @allow_mail_to = qw(you@your.domain some.one.else@your.domain localhost);Remove you@your.domain and some.one.else@your.domain and enter your Basic Plus Hosting account domain name. The line should look like this if your domain name were MY-DOMAIN.NAME: @allow_mail_to = qw(MY-DOMAIN.NAME localhost);This will allow FormMail to send e-mail to any valid username on your Hosting Account. You can also specify specific recipient addresses in this field. For example, if you wanted to be able to send mail only to the user ME@MY-DOMAIN.NAME, you would simply add ME@MY-DOMAIN.NAME instead of just MY-DOMAIN.NAME to the list. When you are done editing the file, save it (as the same name) and exit the text editor. Upload the script to your Hosting Account
Create an HTML FormIf you already have a form, it should now be using the new FormMail.pl script. If it does not work, check to make sure that you are using the correct path to the script and that the script has the same domain and account as your form uses.If you don't already have an HTML form, create a new file in your www/htdocs/ directory using the File Manager and create one. The following code is an example of how to use FormMail. You may want to adapt the code for your specific use. <form method="POST" action="/cgi-bin/FormMail.pl">Once you have the form in place, test it to make sure that it works properly. Documentation |
|
| Home | Site Map | Customer Backroom | Copyright © 1997-2008 AlpineWeb Design |