mail-javascript.php
<?php
if (isset($_POST['submit']))
{
$headers = "FROM:editor@example.com\n";
$body = $_POST['name'].",id=".$_POST['id'];
mail($_POST['recipient'],"News",$body,$headers);
echo "The article has been mailed to ".$_POST['recipient'];
}
?>
<form action="mail.html" method="post">
<input type="hidden" name="id" value="<?php echo $_GET['id'];?>" />
Email:<input type="text" name="recipient" size="20" maxlength="40" value="" />
Your name:
<input type="text" name="name" value="" />
<input type="submit" name="submit" value="Send Article" />
</form>
Related examples in the same category