Setup a Form to Email

What you would use this for: To provide a web based form from which your visitors can send you an email.

What You Need:
An FTP client (Transmit - external link)

A text editor (TextWrangler - external link)

1. First, have to create the form. Below is HTML code for the form. This code is only for the form element of your page and is not a complete HTML document. It is meant for you to paste into an existing HTML document's code.

<form action="http://www.yourdomain.com/cgi-sys/FormMail.cgi" method="post">

<input name="recipient" type="hidden" value="me@examplesite.com">

<input name="redirect" type="hidden" value="http://www.examplesite.com/response.html"> Your Name: <input name="realname">

Your Email Address: <input name="email">

Subject: <input name="subject">

Message: <input name="message">

<input name="Submit" type="submit" value="Submit">

</form>

2. You will need to change a couple of things and you may want to change others. So, let's break down the following information line by line.


<form action="http://www.yourdomain.com/cgi-sys/FormMail.cgi" method="post">

This tells the form where to submit to. Replace www.yourdomain.com with your actual domain name in the above tag.


3. <input name="recipient" type="hidden" value="me@examplesite.com">

This is the only required field. It tells the mail script where to send mail submitted using this form.

4. <input name="redirect" type="hidden" value="http://www.examplesite.com/response.html">

This field will be hidden on your form, but it tells the server which page to serve up upon successful submission of the form.

5. Your Name: <input name="realname">

This is the field where your guest will type in their name.

6. Your Email Address: <input name="email">

This is the field where your guest will type in their email address.

7. Subject: <input name="subject">

This is the field where your guest will type in a subject line for the email they are sending you. You can also specify the subject line of the email, instead of leaving it up to your guests. The way to do that would be to replace the Subject: <input name="subject"> line with <input name="subject" type="hidden" value="My Subject Line"> Of course, you'd want to replace "My Subject Line" with your desired subject.

8. Message: <input name="message">

The is the field where your guest will type their message to you.

9. <input name="Submit" type="submit" value="Submit">


This line creates that nifty little submit button at the end of the form.

10.
</form>

This closes out the form.

11. Upload the page that contains your form and your response.html page into your public_html folder. 

That's it. You should be able to point your browser to the page that contains your email form and send yourself an email.

  • 21 Users Found This Useful
Was this answer helpful?