I have two questions regarding a PHP form processor I'm using. The first question regards having a user select from a drop down menu what email address they would like the form data to go to. The second is how do I pass a file attachment from the form into the email that get's sent? Below is the Form Processor I'm using, which is pretty straight forward. Thanks in advance for any help you can give me.
Form Processor:
<?
///////////////////////////////////////////////////////////////////
// PERFECT //
// ------- //
// PHP E-mail Receive Form Electronic Content Text //
// File: feedback.php //
// Version: 1.7 (January 20, 2008) //
// Description: Processes a web form to read the user input and //
// then send the data to a predefined recipient. You are //
// free to use and modify this script as you like. //
// Instructions: Go to "http://www.centerkey.com/php". //
// //
// Center Key Software *
www.centerkey.com * Dem T. Pilafian //
///////////////////////////////////////////////////////////////////
// Configuration Settings
$SendFrom = "Form Feedback <email@email.com>";
$SendTo = "email@email.com";
$SubjectLine = "New Full Application";
$ThanksURL = "thanks.html"; //confirmation page
// Build Message Body from Web Form Input
foreach ($_POST as $Field=>$Value)
$MsgBody .= "$Field: $Value\r\n";
$MsgBody .= "\r\n" . @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\r\n" .
$_SERVER["HTTP_USER_AGENT"];
$MsgBody = htmlspecialchars($MsgBody, ENT_NOQUOTES); //make content safe
// Send E-Mail and Direct Browser to Confirmation Page
if(!mail($SendTo, $SubjectLine, $MsgBody, $file "From: $SendFrom\r\nReply-To: $SendFrom\r\n"))
die('<h1>Error: There was an error processing your form. Please try again later.</h1>');
header("Location: $ThanksURL");
?>