#!/bin/sh
TMP="/tmp/xxx.$$";

if [ "$1" = "" ]
then
	echo
	echo "Hey, you forgot to enter your name.  Try again, or"
	echo "just leave this menu if you don't want to file a form."
	echo
	exit
fi

if [ "$2" = "" ]
then
	echo
	echo "I can't send you e-mail unless you enter your e-mail address."
	echo "Just leave this menu if you don't want to file a form."
	echo
	exit
fi


echo >> $TMP
echo "Dear $1"  >> $TMP
echo  >> $TMP
echo "Thanks for trying this prototype of an interactive form." >> $TMP
echo "A copy of this message is being emailed to you at" >> $TMP 
echo >> $TMP
echo "                " $2 >> $TMP
echo >> $TMP
echo >> $TMP
echo "If you have any comments send them to" >> $TMP
echo "John Franks (john@math.nwu.edu)" >> $TMP
echo >> $TMP
if [ "$3" = "" ]
then
echo "P.S. You should have tried picking a color -- it's neat." >> $TMP
else
echo "P.S.  I like $3 too." >> $TMP
fi
echo >> $TMP

cat $TMP
/usr/ucb/mail -s "Interactive Form" $2 < $TMP
rm $TMP
exit 0
