I have a listbox in a form, that allows for multiple selections, so you can pick who you want to mail the results of the form to. Here's the code.
<?php
foreach ($emailTo as $value){
$message =. "Company Name: $companyName \n";
$message =. "Site Name: $siteName \n";
if ($contactName == 'None'){
$message =. "Contact: $contactOther \n";
}
else if ($contactName != 'None'){
$message =. "Contact: $contactName \n";
}
$message =. "Contact Person's Phone Number: $phoneNumber \n";
$message =. "Support Level: $supportType \n";
$message =. "Expiration Date of Support: $supportExpires \n";
$message =. "Sales Representative: $salesRep \n";
$message =. "Problem With: $problem \n";
$message =. "Description of Problem: $issue \n";
mail( $value , 'GSI Support Ticket Opened', $message);
}
header ( "Location: [url]http://www.xxx.com/xxxxxxxxxxxx/xxxxxxxxxxxxxxx.php[/url]");
?>
I don't know why it isn't working. The thing that really stinks is that my http server doesn't display php error messages, and my internal IIS server I use for testing constantly gets internal errors, so I don't know where the error is. I think maybe the foreach loop should be placed somewhere difference, or maybe be inserted into the mail() function itself. Any ideas or problems that anyone sees? This drives me nuts.