FM SiteMail >>
Documentation1.1
Installation
Follow the steps below exactly and you should
have your own form mailer up and running in a couple of minutes. Do the steps as you read
through them. If it tells you to do something, do it straight away. This will ensure that
you get it right the first time.
Step 1.1.1 -
UNZIP
Extract the .zip file in which FM SiteMail came.
Step 1.1.2 - EDIT MAIL.CGI
Change the paths in mail.cgi to point to the correct locations of
your server.
A good text editor to use is Textpad at ( http://www.textpad.com).
Make sure that the first line in the script points to your Perl intepreter on your server
or hosting account.
Example: #!/usr/bin/perl
[Here are the variables & paths that should be changed:]
### LOCATION OF SENDMAIL PROGRAM
$sendmail_loc = "/usr/sbin/sendmail";
The above path is the location to the sendmail program on your
unix/linux host. If you don't know the path to this program contact your ISP/Host and ask
them what the full server path to the sendmail program is.
### SENDER NAME - FORM VAR = name
$sendername = "Your Help Desk";
The name from where all email will be sent when sending an
autoresponse.
### FROM EMAIL SENT - FORM VAR = email
$fromemail = "you\@yourdomain.com";
This is the email address from where the confirmation was sent.
### EMAIL SUBJECT - FORM VAR = subject
$mail_subject = "support confirmation";
The subject of the confirmation e-mail.
### TO WHOM IS EMAIL SENT - FORM VAR = to
#$toemail = "you\@yourdomain.com";
The email address of the resipant(receiver) - the ' \ ' sign is
required.
eg. $toemail = "jhon\@192.168.21.6";
### LOCATION OF CGI SCRIPT
$cgi_loc = "/home/yourdomain.com/cgi-bin/mail";
Enter the full server path to mail.cgi.
After you have completed this operation, remember to
save mail.cgi in the unix file format.
==mail.cgi is now configured !==
You may save and close it.
Step 1.1.3 - UPLOAD
FILES
Upload all files from the cgi directory [mail.cgi, *.html, *.txt]
to /home/yourdomain/cgi-bin/(mail) (a subdirectory if you wish) and Chmod their
file attributes to 755.
How
do I set/assign permissions to directories and files?
Upload contact.html (www directory) to your public HTML
document folder. Load it up in your browser, fill in the form and press the submit
button. You should receive an email from the form confirming that it was received.
1.2 Installation
Trouble Shooter
Installation of FM SiteMail should go smoothly if you
follow the installation instructions exactly as described in the above installation steps.
1.2.1. Is the permissions of
the 'cgi-bin/(?)' DIRECTORY 777 ?
To chmod the 'data' directory, do the following:
Ftp/Telnet into your hosting account.
Set permissions of the 'data' directory to 755
1.2.2. Is the permissions of the FILES in the
'cgi-bin/(?)' directory set to 755 ?
Ftp/Telnet/SSH into your hosting account.
Set all the files that you transferred to the 'data' directory
to the permission setting of 755.
1.2.3. Is the permissions for the 'HTML' directory correct?
To assign/set permissions of 777 to the 'html' directory,
do the following:
FTP/Telnet/SSH into your hosting account
Set the permissions of the 'html' directory to 777
1.2.4. Is the path to the perl interpreter in the .cgi
files correct?
If you are not sure where your perl interpreter is located, telnet into your hosting
account/server and type the following at the prompt: which perl
This command will display the location of perl.
If this path is not correct do the following to correct it.
Open all cgi script(s) with a text editor and ensure that the first line which reads
'#/usr/bin/perl' is set to the correct path where your perl interpreter resides.
If it is not set to the correct path of perl, please change the path to the correct
location of your perl interpreter. You will have to open all scripts to set the path of
perl if the current path is not correct.
1.2.5. Does all the .cgi files have the correct
permissions?
Ensure that all the .cgi script files have permissions set to 755.
1.3 Customization
Instructions (Unix)
1.3.1. Explanation/use
of:
a.) CONTACT.HTML
FM SiteMail contains a hidden variable which
is called fn in contact.html - contact.html do not have to be named contact.html - you can
give it any name you would like to use.
#When looking at this here code you'll see the
use of the hidden var "fn" :
# $rsp = $fields{'fn'} . "_response.txt";
Inside contact.html there will be a hidden
form variable called fn
'fn' acts as a placeholder for whatever value
'fn' has.
In our case fn = contact; so that the other files (starting with contact*) can work with
the script.
To change fn:
* open contact.html with a web editor (eg. frontpage)
* right-click anywhere inside the dotted square
* choose 'form properties' from the popup menu
* click advanced
* select fn & click modify
* change fn's value to support (example)
If you decide to rename your fn value in
contact.html to 'support' you must also rename all the other files that started with
contact ( you will then have for example: support.txt, support_error.html,
support_response.txt & support_thanks.html)
b.) CONTACT.TXT
This file contains all the error messages used
by contact.html.
Text inside this file gets displayed when the user forgets to enter a
field that is required by contact.html.
How to set up required fields (fields that has to be completed
by users) :
You will most probably want to add fill-in-boxes to contact.html
Lets use a fill-in box/field with the name 'phone' for example.
Now open contact.txt and place the word 'phone' in it.
(the name of the fill-in-box)
After phone place a colon - after the colon place error text that will be
displayed to the user when he tries to submit the form without filling
in something in the phone field or fill-in-box.
The line inside contact.txt should look something like this:
'phone:Please supply us with your phone number'
If you later don't want phone to be a required field; simply delete the above error
message line from contact.txt
c.) CONTACT_ERROR.HTML
If you open this file in a web editor you'll
see the text '%%problem%%'.
Remember those error messages from contact.txt? Depending on the user's mistake a
corresponding message will be displayed in '%%problem%%'.
d.) CONTACT_THANKS.HTML
This page merely contains a message
like...
"We will tend to your request as soon as
possible. " (customizable, of course!)
...that is displayed to the user once all fields in contact.html have been
correctly filled.
1.3.2. When all files have been set up to your
liking:
Upload all files from your cgi directory
[mail.cgi, *.html, *.txt] to your cgi-bin/(mail)(the path YOU used in mail.cgi) directory
and Chmod their file attributes to 755; Upload "contact".html to your www
dir.
1.3.3. Test
Test this script by launching it through
your web-browser
for example : http://yourdomain.com/contact.html
will execute the script
at http://home/yourdomain.com/cgi-bin/(mail)/mail.cgi
1.4
Uninstallation
To remove FM SiteMail from your server/hosting account,
simply delete all .cgi, .txt & html files that you transferred while doing
the installation.
|