How to install and use CGIEmail using cPanel.
Written by Avesta Sabetian Wednesday, 19 August 2009
This is a easy overview on how to install and then use cgiemail on your cPanel account. If you are with Arvixe, and are on a standard plan, you have cPanel and this tutorial will apply to you. In this example, we will assume our domain name is the subdomain “http://stats.lizard.arvixe.com”.To start, login to cPanel, then follow the following steps.
Your going to first need a host that can host cgiEmail. Looking for a reliable host? Try cgiEmail Hosting.
1. On the top left of your cPanel, you will find a “Find” box:
2. Inside it, type “cgi” and most of the buttons will disappear except the one we want to use: “CGI Center”. Click on it to enter the CGI Center.
3. Once inside the CGI Center, you will see several options. Look for “CGI email“, it should be near the bottom, click on it:
4. Congratulations! If you see this page when you click “CGI email” then it was just properly installed in your hosting space:
5. We will be doing nothing with that page, its now time to use cgiemail. First, you will need to make a form. Create an .html file in your public_html folder and place the following sample form into it like below. For our purposes, we named it sampleform.html, do the same if you would like to follow along with the tutorial easier
The contents of sampleform.html:
Your name: <INPUT NAME=”yourname”><p>
Your favourite colour: <INPUT NAME=”color”><p>
<INPUT TYPE=”submit” value=”Send e-mail”>
A few modifications will have to be made. Change this:
Of course change “YOURDOMAIN.com” in the above to your domain name.
Great, you have the form setup, it should be at http://www.YOURDOMAIN.com/sampleform.html. In the case of this example, its at http://stats.lizard.arvixe.com/sampleform.html
6. Setting up the template. First make a file inside your “cgi-bin” folder located in your “public_html” folder and call it “sampletemplate.txt”. This will be the email template. Inside it, put the following:
From: [email protected]
Of course change the 2 instances of “[email protected]” to your own email address that exists. To test it out, go to the form location on your site:
The output should look like this if successful:
The form is submitting variables into the cgiemail script. So an input like this:
Will send a variable “yourname” to the cgi script.
And inside of your cgi “template”, sampletemplate.txt, you call the variables.
The “ACTION” in the form is calling the cgi template file:
That address consists of 3 items:
First the domain name: http://stats.lizard.arvixe.com
Secondly the location of cgiecho: /cgi-bin/cgiecho
Followed by the location of the sample template file: /cgi-bin/sampletemplate.txt
Combine all three together and you get: “http://stats.lizard.arvixe.com/cgi-bin/cgiecho/cgi-bin/sampletemplate.txt”
Going to it directly will give a template error, disregard.
The above should be sufficient information to get you going with cgiemail. If you run into any problems, feel free to share them in the comments below or in the community forums.