I am using an external PHP file to package the contents of a html form and e-mail it. What was just asked of me is that if they check a certain location in the form (ex. Rochester, Tuscon, etc.) if the form could be sent to a address specific to that checkbox. Below is a link to the form in question and the php code that makes it work. Thanks in advance.
www.drawninwardmedia.com/nursecore2/apply.html
*----PHP----*
<?php
///////////////////////////////////////////////////////////////////
// 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
require('mail/attach_mailer_class.php');
$sendername = 'Form Feedback';
$SendFrom = "applications@nursecore.net";
$SendTo = "applications@nursecore.net";
$SubjectLine = "Request More Info: Apply Submission";
$file = null;
$ThanksURL = "thanks.html"; //confirmation page
// Build Message Body from Web Form Input
foreach ($_POST as $Field=>$Value){
$MsgBody .= "$Field: $Value\r\n";
}
if($_FILES['attachment']['tmp_name'] != ''){
move_uploaded_file($_FILES['attachment']['tmp_name'], './tmp/'.$_FILES['attachment']['name']);
$file = './tmp/'.$_FILES['attachment']['name'];
}
$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
$mailer = new attach_mailer($sendername, $SendFrom, $SendTo, '', '', $SubjectLine, $MsgBody);
$mailer->extensions = array('.pdf', '.doc', '.docx', '.txt');
if($file != null){
$mailer->create_attachment_part($file);
}
if(!$mailer->process_mail()){
unlink($file);
die('Could not send message. Please try again later.' . " $mailer->show_error_str()");
}
unlink($file);
header("Location: $ThanksURL");
?>