Search the Community
Showing results for tags 'form handler'.
-
Hello, Something is wrong with the below php code that allows the form to send to three separate recipients with three separate messages. Something in the below code is causing recipients A's email to come through just fine. The problem is that recipient B receives A's message as well as their message and recipient C to receive A's and B's message as well as their message. (I hope that makes sense!). Note: I have changed some of the text for anonymity purposes. I'm sure I'm missing something simple that closes/ends the first email but I'm not sure what. Please help. Thanks! <?php $to = 'me@domain'; $subject = 'subject line'; $url = 'http://www.domain.com/confirmation.html'; $headers .= "From: info@domain.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message .= '<html><body>'; $message .= " "; $message .= " "; $message .= "<strong>Referral</strong></br>"; $message .= "The following information has been submitted by " . strip_tags($_POST['submitter']) . " with ID " . strip_tags($_POST['MID']) . " on " . strip_tags($_POST['Today']) . ".</br>"; $message .= "Please reach out to the following referral:</br>"; $message .= "Name: " . strip_tags($_POST['name']) . ".</br>"; $message .= "Contact Phone: " . strip_tags($_POST['phone']) . ".</br>"; $message .= "Email Address: " . strip_tags($_POST['email']) . ".</br>"; $message .= "</br>"; $message .= "</br>"; $message .= "</br>"; $message .= "Thank You!"; mail($to, $subject, $message, $headers); $to = $_POST['semail']; $subject = 'Thank you for your submission!'; $headers .= "From: info@domain.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message .= '<html><body>'; $message .= " "; $message .= " "; $message .= "Dear " . strip_tags($_POST['submitter']) . ",</br>"; $message .= "Thank you for your submission! </br>"; $message .= "We will reach out to " . strip_tags($_POST['name']) . " per your referral. </br>"; $message .= "</br>"; $message .= "We appreciate your time and thank you for your support!"; $message .= "</br>"; $message .= "Have a great day,"; mail($to, $subject, $message, $headers); $to = $_POST['email']; $subject = "" . strip_tags($_POST['submitter']) . " wanted us to call you!</br>"; $headers .= "From: info@domain.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message .= '<html><body>'; $message .= " "; $message .= " "; $message .= "Dear " . strip_tags($_POST['name']) . ",</br>"; $message .= "Recently, " . strip_tags($_POST['submitter']) . " provided us with your information because they wanted to let you know about the great experience they have had with our company and how you could benefit from the services they currently use.</br>"; $message .= "We are sending this email to confirm your contact information. One of our expert Account Service representatives will be reaching out to you at " . strip_tags($_POST['phone']) . " shortly to discuss the services we can offer to your company.</br>"; $message .= "</br>"; $message .= "We appreciate your time and look forward to speaking with you!"; $message .= "</br>"; $message .= "Have a great day,"; mail($to, $subject, $message, $headers); echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">'; ?>