rendered paste body<?php
function get_post() {
$key = array_keys($_POST);
$value = array_values($_POST);
$answers = "";
for ($i=0; $i<count($_POST)-1; $i++) {
if (substr_count($key[$i], 'mce') != 1) {
$answers .= "
<tr>
<td width='280'><b style='font-family:verdana;'>".str_replace("_", " ", $key[$i]).": </b></td><td width='280' style='font-family:verdana; font-size:11px;'>".$value[$i]."</td>
</tr>\n
<tr>
<td height='20'></td>
</tr>
";
}
}
return $answers;
}
#=======================================================================
# Determine what address to cc to
if ($_POST ['Sales_Rep_Manager'] == "nasc@aplus.net") {
$cc = "juliap@aplus.net";
// $cc2 = "rfq@aplus.net";
} else if ($_POST ['Sales_Rep_Manager'] == "chrisp@aplus.net") {
$cc = "christinec@aplus.net";
// $cc2 = "rfq@aplus.net";
} else if ($_POST ['Sales_Rep_Manager'] == "philipl@aplus.net") {
$cc = "christinec@aplus.net";
// $cc2 = "rfq@aplus.net";
} else if ($_POST ['Sales_Rep_Manager'] == "allyd@aplus.net") {
$cc = "juliap@aplus.net";
// $cc2 = "rfq@aplus.net";
} else if ($_POST ['Sales_Rep_Manager'] == "kerrys@aplus.net") {
$cc = "juliap@aplus.net";
// $cc2 = "rfq@aplus.net";
}
#=======================================================================
# Set constant Email Variable
$email2 = 'rfq@aplus.net';
$email3 = 'dennisk@aplus.net';
$acct_manager_email = $_POST['Account_Manager_Email'];
#$acct_manager_email .= "From: ".$_POST['Account_Manager_Email']."\n";
#=======================================================================
# Message subject
$subject ='Portal RFQ - '.$_POST['Customer_name'];
#=======================================================================
# To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
#=======================================================================
# Message from
$headers .= "From: ".$_POST['Account_Manager_Email']."\n";
#=======================================================================
# Message body
$message="
<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<meta content=\"text/html;charset=ISO-8859-1\" http-equiv=\"Content-Type\">
<title></title>
</head>
<body bgcolor=\"#ffffff\" text=\"#000000\">
<b><font face=\"Verdana\">".$_POST['Customer_name']."</font></b><br>
<table border='1' cellpading='0' cellspacing='2' width='640'>
".get_post()."
</table>
</body>
</html>
";
// Mail to account manager and email contact specified in $location
mail($acct_manager_email,$subject,$message,$headers);
mail($location,$subject,$message,$headers);
mail($email2,$subject,$message,$headers);
mail($email3,$subject,$message,$headers);
mail($cc,$subject,$message,$headers);
mail($cc2,$subject,$message,$headers);
// Redirect Page
header("Refresh: 0;url=rfq-completed.html");
?>