I'm trying to email the results of a form to a number of email addresses. The form has a listbox that displays names, with the email addresses as values. You can select multiple entries in the listbox. I want the results of the form to be emailed to whichever names are picked when it is submitted.
<?php
foreach ($emailTo as $value){
echo("$value");
if ($contactName == 'None'){
$message =. "Contact: $contactOther \n";
}
else if ($contactName != 'None'){
$message =. "Contact: $contactName \n";
}
$message =. "Company Name: $companyName \n";
$message =. "Site Name: $siteName \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";
if (@mail($value , 'Support Ticket Opened' , $message)) {
echo('<p>Mail sent successfully.</p>');
}
else {
echo('<p>Mail could not be sent.</p>');
}
}
include 'resultspage.php';
?>

I'm having problems finding out what the issue is, and I can't pinpoint it because my testing server is foo-bar'd. Any ideas?