Sure you can use a cgi script to process a form that your user submits and have it emaail it to you, but why not use PHP? I understand php much better, and the code is fairly simple.
form.html (the user submitted form)
Code:
<form name="form1" method="post" action="processmail.php">
<input type=hidden name="required" value="email,text">
<table width="531" border="0" cellpadding="5">
<tr>
<td width="147" align="left" valign="middle">Name</td>
<td width="358"><input name="name" type="text" id="name" size="24"></td>
</tr>
<tr>
<td align="left" valign="middle">Email Address <span class="title">*</span> </td>
<td><input name="email" type="text" id="email" size="24"></td>
</tr>
<tr>
<td align="left" valign="middle">Subject</td>
<td><input name="subject" type="text" id="subject" size="24"></td>
</tr>
<tr>
<td align="left" valign="middle">Message <span class="title">*</span> </td>
<td><textarea name="text" cols="50" rows="6" id="text"></textarea></td>
</tr>
<tr>
<td align="left" valign="middle"><span class="title">*</span> = required </td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form>
Just save that as whatever name you want for now, you can modify it later.
processmail.php (the script)
Code:
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$text = stripslashes($text);
mail('email@domain.com',$subject,$text,"From: $name <$email>");
?>
Simple code, just make sure that you have a variable for everything you are posting to this. Extra variables you will want to put in the text area, like this:
Code:
mail('email@domain.com',$subject,"$text $extra_variable extra_variable","From: $name <$email>");
If you want something to display after the user submits the data (like a page that says the data was submitted successfully), then just add your HTML code in the process.php file after the code I gave you above.
Now I may have not explained it as best as I could have.. but I have een using this code for a while so I am not that good at thinking how it was when I didn't know it. If you need help setting this up on your site, just reply here, send me a private message, or contact me via one of the instant messenger programs in my profile.
Also, if you want to see how the form looks, or how it works, I have this running on my site at
http://www.dewknight.com/contact.php. But please don't submit it multiple times, it actually does send me an email when you submit it.