PX : code

Canned Mailer by Bill Bird
Download this code


// Sample HTML file
<form method="POST" action="canned_mailer.php3">
  <p>Your E-mail Address: <input type="text" name="email" size="20"><br>
  <input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
  <input type="hidden" name="canned_file" value="canned_sample.txt"><input type="hidden" name="confirm_message" value="Thank you for using our canned mail script!">
  <input type="hidden" name="subject" value="Canned Mail">
</form>

// Name this file "canned_mailer.php3"
<?php
//Canned Mailer written 2000 by Bill Bird 
mail"$email"
"$subject" , include "$canned_file"); // This gets the email address and the subject from the form (The Subject should be in a hidden element)

if ($goto) {
header"Location: $goto" ); //Redirects if an element on the form specified a value for "Goto"
}
elseif (
$incl_file) { // Writes a file to the screen, can be HTML
include "$incl_file";
exit();
}
elseif (
$confirm_message) { //Writes a form-specified (Hidden Element) message to the screen, can contain HTML
echo "$confirm_message";
exit();
}
else { 
// If all else fails, use this message.
echo "Thank you for your interest. The Information has been sent.";
}
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.