Hi everyone, I'm creating a form that depending on what is selected from a drop down specific people get emailed. I can do this without a problem if each drop down is set to only go to one email address. Once I start adding an array to the array is where I get lost.
This is my working example
$to = $_REQUEST['category'];
$headers = "From: customerservices@example.com";
$subject = "TestArray";
$body = "The following information has been submitted:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$category = array(
'Donor Application' => 'customerservices@example.com',
'eBridge Related' => 'customerservices@example.com',
'Hitsheet Related' => 'customerservices@example.com',
'Add/Remove Employee' => 'customerservices@example.com',
'Operations' => 'customerservices@example.com',
'eMail Related' => 'customerservices@example.com',
'Phone Related' => 'customerservices@example.com',
'Printing Related' => 'customerservices@example.com',
'Remote Access' => 'customerservices@example.com',
'RESource Related' => 'customerservices@example.com',
'SharePoint Related' => 'customerservices@example.com',
'Solomon Related' => 'customerservices@example.com',
'UltiPro Related' => 'customerservices@example.com',
'USS Related' => 'customerservices@example.com',
'Other' => 'customerservices@example.com',
);
$my_email = $category[$_REQUEST['category']];
$send = mail($my_email, $subject, $body, $headers);
When I add an array in the array I don't know how to email, for example
$category = array(
'Donor Application' => array('customerservices@example.com','administrator@example.com')
'eBridge Related' => array('customerservices@example.com','test@example.com')
);
Any help is appreciated!
Thanks!