Abstract:
This program was designed to solve a very simple problem: to take the data from a form and mail it to an e-mail address (while using a Mac web server). Until now the only way you could do this was to use MacPerl or Applescript which works fairly well, but I wasn't pleased with how long it took to generate a response for the end user. After discovering how well-written John Norstad's Mail Tools Gateway was, I immediately started hacking at it until it would solve my form/mail problem. I've been extremely impressed with how fast and efficient John's code is even after I've gone in and kludged my way around.
I hope you enjoy using this as much as I have. If you want a more detailed description of how this cgi works, then please read John's Mail Tools Technical Information page. The on-line version of this ReadMe can be found here.
Modifiable standard header and footer with ResEdit
Extremely fast threaded ACGI
Written entirely in Metrowerks Codewarrior
Fat binary (works on both 68k and PowerMac)
Webstar, MacHTTP, Netpresenz, Webserver 4D, or any other Macintosh web server that supports CGIs.
Thread Manager (integrated with 7.5)
Access to an SMTP server
The following field names have special meanings:
You can put a '*' before any field name to keep it out of the e-mail response.
Any of those fields can be of type "hidden" so they don't show up on the form.
The above form was made with this:
<FORM ACTION="http://www.sbamug.com/cgi-bin/RWforms.acgi"
METHOD=POST>
<P><FONT SIZE="+2"><STRONG>Send yourself a test
message:</STRONG></FONT>
<P>Your name: <INPUT TYPE=text NAME=Name VALUE="" SIZE=30
MAXLENGTH=50>
<P>Your e-mail address: <INPUT TYPE=text NAME="*mailto"
VALUE="" SIZE=30 MAXLENGTH=50>
<P>Subject: <INPUT TYPE=text NAME="*mailsubject" VALUE=""
SIZE=30 MAXLENGTH=50>
<P>SMTP Host: <INPUT TYPE=hidden NAME="*smtphost"
VALUE="sbamug.com" SIZE=30>
<P>Comments or Questions:
<P><TEXTAREA NAME=Comments ROWS=10 COLS=50 WRAP=virtual>I
love Macs!!!</TEXTAREA>
<P><INPUT TYPE=submit NAME=Submit VALUE="Send
Message">
<INPUT TYPE=reset VALUE="Clear Message">
<INPUT TYPE=hidden NAME="*mailfrom"
VALUE="forms.acgi-test@nowhere.foo">
</FORM>
If you want to make a web form that is mailed to YOU, then you need to make several adjustments. See the Bold below.
<P>Comments or Questions:
<P><TEXTAREA NAME=Comments ROWS=10 COLS=50 WRAP=virtual>I
love Macs!!!</TEXTAREA>
<P><INPUT TYPE=submit NAME=Submit VALUE="Send
Message">
<INPUT TYPE=reset VALUE="Clear Message">
<INPUT TYPE=hidden NAME="*mailto"
VALUE="youremail@server.com">
</FORM>