How do I create a contact form that will send an email?

cPanel Email cPanel Email Read Time: 1 Min Write a comment

Built into the CPanel control panel is a form mailer script you can use to send the results of a form to yourself via e-mail.

Simply create an html form, and set the action attribute to /cgi-sys/formmail.pl

In your html form, include the following hidden fields (case sensitive, don't capitalize):

recipient: The e-mail address where the form data will be sent
subject: The subject line for the e-mail

The following hidden field is optional:

redirect: Thank you page to redirect to after submission

Also include the following recommended visible fields in your form:

email: The e-mail address of the form submitter
realname: The name of the form submitter

Include fields for any other information you want to collect, and they'll be included in the e-mail.

A simple example form:

<form action="/cgi-sys/formmail.pl" method="post">
<input type="hidden" name="recipient" value="This email address is being protected from spambots. You need JavaScript enabled to view it.">
<input type="hidden" name="subject" value="Form Submission">
<input type="hidden" name="redirect" value="thankyou.htm">
Your name: <input type="text" name="realname" size="50" maxlength="100">
Your email address: <input type="text" name="email" size="50" maxlength="100">
Your comments: <input type="textarea" cols="40" rows="5" name="comments"><textarea>
<form>

The downside to this approach is that the recipient email address is embedded in the form, and can be harvested by spam bots.

If you'd rather not have an email address embedded into the form, try this free, third party form mail solution:

Tectite

The nice thing about this script is that it allows you to configure the script from their website via an online wizard, and then you are presented with a fully configured mail form that you can download.

Write comments...
or post as a guest
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.