07 Feb 2012 
Support Center » Knowledgebase » cPanel » Using Formmail
 Using Formmail
Solution All you need to setup formmail, is to create your form. A very simple form might look like:

<FORM NAME="test" ACTION="/cgi-sys/formmail.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="recipient" VALUE="email@domain.com">
Enter your Name: <INPUT TYPE="text" NAME="name"><br>
<INPUT TYPE="SUBMIT"> </FORM>

The only real requirement in order to get FormMail to work properly is the ACTION=/cgi-sys/formmail.pl and INPUT TYPE="hidden" NAME="recipient" VALUE="email@domain.com". Where email@domain.com is an email address you have set up on your domain.

Another example of FormMail, which utilizes more of the special features is listed below:

<FORM NAME="test" ACTION="/cgi-sys/formmail.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="recipient" VALUE="email@domain.com">
<INPUT TYPE="hidden" NAME="subject" VALUE="This is a test form">
<INPUT TYPE="hidden" NAME="redirect" VALUE="http://yourdomain.com/redirect.html">
<INPUT TYPE="hidden" NAME="required" VALUE="email,realname">
E-Mail Address: <INPUT TYPE="text" NAME="email"><br>
Name: <INPUT TYPE="text" NAME="realname"><br>
Favorite Color: <INPUT TYPE="text" NAME="color"><br>
<INPUT TYPE="SUBMIT">
</FORM>

In this example, you will notice the same ACTION="/cgi-sys/formmail.pl" and INPUT TYPE="hidden" NAME="recipient" VALUE="email@domain.com"..

There are other INPUT TYPE="hidden" types are are listed below:

  • subject -- This defines what you want the subject of the email to be. Be sure to use the quotation marks if it is more than one word.
  • redirect -- This defines what page you want the visitor to be taken to, after successfully completing the form. You will need to specify the full URL.
  • required -- The parameter takes on a list of the required fields that must be filled out in order for the form to be processed.
  • email -- This is considered a special parameter, because this is who the form will appear that it was sent from. This is useful, because in most email clients, you will be able to hit a Reply button and send a message back to this email address without having to type it in.
  • realname -- This will appear along with the email parameter. Instead of the mail appearing to come from just the said email address, this name will appear to the email address. This allows for a more personalized touch when replying back to the address.


Article Details
Article ID: 59
Created On: 13 Aug 2008 03:43 PM

 This answer was helpful  This answer was not helpful

 Back
 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Troubleshooter | News | Downloads
Language:

Help Desk Software By Kayako eSupport v3.30.02