Page 1 of 1

Email Form for web page

PostPosted: Fri Nov 25, 2005 8:49 am
by Cricket
I'd like to put a form on our website that users can fill in to get more information. Something very simple: their email, their question.

I tried to use the one from CPanel, and got stuck. cgiemail is now installed in the cgi-bin directory, but I've no idea how to use it. The FAQ points to a tutorial for FormMail, which says configuring it is easy and then loses me. (Change the perl script?)

As I understand it, I have to do the following:

1. Install a cgi program on the server. (I think that's done, thanks to my experiments with CPanel, but I've no clue how it's configured or how to check. There is definitely a file named , but I'm not even sure if this is the program the tutoiral is for.)

2. Put something like the following in my html code:

<FORM method=POST action="">
Your email:
<input type="text" name="email" size="40">
Your question:
<textarea cols="50" rows="15" name="question">
<input type="submit" value="Send">

3. The user fills in the form, hits "Send", and I will get an email with his email and question.


a) How do I tell the cgi where to send the question? (

b) Will the cgi tell the user they've done it right? (I just hate clicking a button and not knowing if it worked.)

Thanks in advance!

PostPosted: Mon Jan 09, 2006 3:32 pm
by kevin

There two form to email scripts in the control panel.

FormMail Clone

Found under the "CGI Center".

The paths are:

It's easier to configure FormMail.
Put this in your forms page:

<form method="POST" action="">
<input type=hidden name="recipient" value="">

<p>Subject <input type="text" name="subject"><br>
Name <input type="text" name="realname"><br>
Your Comments <input type="text" name="comments"><br>
<input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="Reset"></p>

Replace with your actual domain name
and with your email address.

More information at:

For cgiemail:

Create a file such as template.txt with the following:

From: [email]
Subject: questions three

What is your name? [yourname]
What is your quest? [quest]
What is your favourite colour? [colour]

Replace with your actual email address.

Upload this file to public_html directory.

Create html forms file, put the following code and upload to public_html:

<form method="POST" action="">

Your e-mail address: <INPUT NAME="email"><p>
Your name: <INPUT NAME="yourname"><p>
Your quest: <INPUT NAME="quest"><p>
Your favourite colour: <INPUT NAME="colour"><p>

<input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="Reset"></p>

Replace with your actual domain name.

The big difference between the two is the creation of a template file for cgiemail and FormMail will only send email results to the domain name hosted under Cpanel while cgiemail can be sent to external one.

PostPosted: Mon Jan 09, 2006 7:03 pm
by Cricket

That explains the problem. I was combining the instructions for two different methods (and I suspect the other sites I looked at added a third and fourth). I eventually got the cgiemail method working, but I'll use FormMail for the next one.

Thanks for the clarification, and I suggest the clarification be coppied to the FAQ.


PostPosted: Thu Jan 12, 2006 1:25 pm
by kevin
It has been added!


Re: Email Form for web page

PostPosted: Tue Feb 16, 2010 2:51 am
by JacobGilpin
I'm trying to put CGI email on my webpage but when I place the code onto the page it just disappears totally. I'll save the code and then when I check my page it's nowhere to be seen. Could this be a problem with cgi email or is it on my side? Has anyone else had this problem?

Re: Email Form for web page

PostPosted: Fri Apr 09, 2010 5:13 am
by Ray

The details of setting up of CGI email can be seen from the link :

Regarding the disappearing of the uploaded file, this should be due to the ConfigServer eXploit Scanner (cxs) running in all our shared servers. Active scanning is performed by CXS on all text files uploaded through:

* PHP upload scripts
* Perl upload scripts
* CGI upload scripts
* Any other script type that utilizes the HTML form ENCTYPE multipart/form-data
* Pure-ftpd

CXS might be detecting your uploaded file as suspicious and will be quarantining it. If you feel this issue persists, open up a ticket to with all the required details, logins and steps to re-create the trouble.