mail-javascript.php : mail « Utility Function « PHP






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

1.Add both name and address values into the email address
2.mail() function mails information to a given recipient.
3.Using mail() to redirect user information
4.Encrypting and Sending Secure Emails Using S/MIME
5.send-email-multiple-recipients-2.php
6.send-email-with-headers.php
7.send-mail-multiple-recipients.php
8.send-plaintext-email.php
9.Sending user-requested information
10.Sends a HTML mail from a given email address:
11.Sending Internet Mail
12.Sending Mail
13.Sending a message with mail()