PHP is a fun, safe reliable tool for this job. Most commercial servers run it these days.
this form uses the POST method (a special HTTP request which hides the users input)
code for page with form to take user input
**********************************
<form method="post" action="mailSender.php">
Your Name: <input type="text" size="30" maxlength="40" name="name"> </input><br > <br >
Your Email: <input type="text" size="30" maxlength="60" name="addy"> </input>
<textarea style="height:100px; width:400px;" name=msg>
</textarea >
<br >
<input type="submit" value="Send"> </input>
</form >
---- end page
code for page which recieves user input
(the code in the first page needs to know this pages name. In page 1 it assumes this page is called mailSender.php)
******************************************************************************************************************
<?php
// POST gets data from referencing page
$body_of_email=$_POST['msg'];
$ad= $_POST['addy'];
$len = strlen($ad);
$pos = strpos($ad, '@');
//check for common typos
if($ad==null || $pos ==false || $len<6)
{
echo "You forgot, or entered the wrong email address Please click back and enter address.";
}
else{
if (mail( '
[email protected]', 'An email from some website', $body_of_email, $ad))
{
echo "<center>";
echo("
<b/> <font color=white size=4> Message successfully sent!</b/>");
echo "
<a href=\"index.php\"> Continue </a/>";
}
else
{
echo(" Message delivery failed...");
}
}
?>
----end page---------