I am creating a form for our salesmen. In the form the salesmen can select one or multiple Customer Service Representatives (CSR) to have the form data emailed to.
Here is my form checkbox code for the Customer Service Representative selection:
[code]
Brian Corse
Jake Egner
Tom Miskovic
Paulette Willits
I want to have the selected CRS’s linked somehow with their emails and then have the emails be somehow combined into the variable “$receiver” in the code below so that each selected CSR gets the form results.
[php]
if( mail( $receiver, $subject, $email_body, “From: $sender\r\n” .
“Reply-To: $sender \r\n” . “X-Mailer: PHP/” . phpversion()) )
{
echo “Success! Your job entry has been sent. Thank You.”;
}
[/php]
I’m just don’t know how to write the code that will loop through the CSR[] results, tie it to the CSR’s emails and combine it into the one variable. I’m assuming I will need to create an array from the values checked in the Cutomer Service selection, starting with $csrs = $_POST[‘csr’]; and have another array for the emails and I would guess use a foreach statement, but I don’t know how to connect the two and combine them into one variable.
I need help.
Adriana