form.html:
<html>
<form method=post action=handler.php>
Name: <input type=text name=the_name>
<br>
Email: <input type=text name=email>
<br>
Fav Color: <input type=text name=color>
<br>
<input type=submit>
</html>
handler.php:
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$color=$_POST['color'];
$message="$name said that his fave color is $color. You can reach $name at $email.";
$success=mail("me@mydomain.com", "$name's fave color", $message);
if ($success) {
echo "Mail sent!";
} else {
die("Could not send email!");
}
Simple, maybe simpler than PERL.... 😉
Note that this simple example is not the greatest: no error checking, no input verification of any type in fact, etc.....