"I know how to write CGI programs, I just don't know how to write forms in HTML."
Check out the Web Communications Forms Tutorial <URL:http://www.webcom.com/~webcom/html/tutor/forms/intro.html>, which will walk you through the process.
See the section on email forms for a simple solution to the most commonly desired form.