This compiled script will allow you to make custom e-mail forms that return nicely formatted output without learning CGI programming. There are basically five steps to follow.
To: strangeman@chasm.big HEADER LINES
Subject: questions three
blank line
What is your name? [yourname]
What is your quest? [quest] BODY
What is your favourite colour? [colour]
The template file consists of two parts. The first part is the message headers. There MUST be a To: line. Put your email address there. There should also be a Subject: line. Put the subject you want the replies to have there.
Some guidelines for creating a working template.
If a file works with cgiecho, but gives you a server error with cgiemail, that means your mail header is invalid. Common reasons for invalid headers are
Within these guidelines there is a lot of flexibility. You can put From:, X-Face:, or any other header in the headers. You can put things like Cc: [yourname] in the headers. Be creative. Just don't put anything in there you wouldn't want us administrators to see, because that's where bounced messages go.
Now go ahead and upload your e-mail template to the WWW server and look at it with your WWW browser.
The next step is to make the form that corresponds with the template. Here is the form that corresponds with the sample template.
(This example doesn't actually send e-mail.)
This is a very simple example. To learn to create more complicated forms, read NCSA's guide. For now, simply note that the NAME of each input corresponds to what you previously put in the e-mail template. In this example they are yourname, quest, and colour.<FORM METHOD="POST"ACTION="http://www.tdl.com/cgi-bin/cgiecho/~crc/questions3.txt"> Your name: <INPUT NAME="yourname"><p> Your quest: <INPUT NAME="quest"><p> Your favourite colour: <INPUT NAME="colour"><p> <INPUT TYPE="submit" value="Send e-mail"> </FORM>
The trickiest part of the HTML form is getting the ACTION set correctly. To do this, you need to take the full URL of your template file, and insert the string "/cgi-bin/cgiecho" right after the servername.
Note for virtuals. The correct reference for you will have no ~username in it. Instead, the proper way to call the script is http://www.yourdomain.com/cgi-bin/cgiecho/file.txt, assuming your file is in public_html. Substitute your domain for "yourdomain.com" and the filename of your template for "file.txt".
So if the template file is "test.txt", and it's stored in ~crc/public_html, the URL for the template file is "http://www.tdl.com/~crc/test.txt". You would put type this URL into the action part of your