Setting up the form2mail script

With special thanks to Dan Graf, dgraf@midcoast.com, we have a simple, easy to use CGI program to allow people who visit a webpage to fill out a form and send the owner or author comments. Works pretty nice.


Important Files:

  • http://www.midcoast.com/cgi-bin/form2mail.cgi
  • postdone.html - This is a simple webpage file you create and put in your public_html directory thanking the person for filling out the form and acknowledging that the form was sent.
  • This document. You can copy the stuff from the example below into the webpage you want to put the form into. Thing in bold are comments and it wont matter if you copy them in or not.

From2Mail - Example


<HTML>
<HEAD>
<TITLE>Feedback on my web page</TITLE>
</HEAD>
<BODY>
What do you think of my page?<BR>

<FORM METHOD="post" ACTION="/cgi-bin/form2mail.cgi">

<!-- This is the place to send the mail to: most often this is your email address. However in some cases you may want to send mail to someone elses address -->

<INPUT TYPE="HIDDEN" NAME="mailto" VALUE="yourusername@yourdomain.com">

<!-- This is the subject which will be on the email message that is sent to the address in the field above. -->

<INPUT TYPE="HIDDEN" NAME="subject" VALUE="User Feedback on my page">

<!-- This is the subject line which will appear on the mail message that is sent to you. -->

<INPUT TYPE="HIDDEN" NAME="reroute" VALUE="HTTP://www.midcoast.com/~username/postdone.html">

<!-- This is the page to go to after the post has been preformed. After the form is submited, the contents of the page specified here will beloaded into the users browser. -->

<!-- Here you begin entering all the fields that you want to be sent in the email message -->

<INPUT TYPE="TEXT" NAME="COMMENT">

<INPUT TYPE="TEXT" NAME="NAME">

<INPUT TYPE="submit" value="Send Comment">

</FORM>