I was updating few non PHP related pages for the client which send form input over to PHP. However without making any changes to the code client reported to not getting the e-mails. Instead he said it only sends emails to one of the emails instead of all 3. Can some one pin point whats wrong with the code?
$email_to = "[email protected], [email protected], [email protected]";
$email_subject = "VIP Access"." [".date("Y-m-d @ h:m:s A")."]";
$first_name = $_POST["objFirstName"];
$last_name = $_POST["objLastName"];
$phone = $_POST["objPhone"];
$email_from = $_POST["objEmail"];
$full_name = $first_name." ".$last_name;
$message = "";
function clean_string($string) {
$bad = array("content-type", "bcc:", "to:", "cc:", "href");
return str_replace($bad, "", $string);
}
$message .= "<html><body>\n";
$message .= "<table rules='all' border='1' style='border-color:#000;' cellpadding='10' width='100%'>\n";
$message .= "<tr style='background: #eee;'><td width='20%'><strong>Full Name:</strong> </td><td width='70%'>".clean_string($full_name)."</td></tr>\n";
$message .= "<tr style='background: #eee;'><td width='20%'><strong>Email:</strong> </td><td width='70%'>".clean_string($email_from)."</td></tr>\n";
$message .= "<tr style='background: #eee;'><td width='20%'><strong>Phone:</strong> </td><td width='70%'><a href='tel:".clean_string($phone)."'>".clean_string($phone)."</a></td></tr>\n";
$message .= "</table>\n";
$message .= "<img src='http://example.com/images/logo-trans.png' width='120' height='130' alt='Estate Brothers' style='text-align:center;'/>\n";
$message .= "</body></html>\n";
// create email headers
$headers = "From: ".$email_from." via example.com\r\n"."Reply-To: ".$email_from."\r\n"."X-Mailer: PHP/".phpversion()."via example.com";
$headers .= 'To: Example <[email protected]>, User <[email protected]>, User two <[email protected]>' . "\r\n";
$headers .= 'MIME-Version: 1.0'."\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
$mail_feed = mail($email_to, $email_subject, $message, $headers);
clean_stringdo? Why do you remove those strings?