<html>
<head>
<title>Multiple Recipient Contact Form</html></head><body>
<form id="contactForm" method="post" action="send.php">
<table>
<tr>
<td><label for="name">Case Number:</label></td>
<td><input id="name" name="name" class="tb"/></td>
</tr>
<tr>
<td><label for="sendTo">Send To:</label></td>
<td>
<select id="sendTo" name="sendTo" multiple="multiple">
<option id="test1" value="test1">test1</option>
<option id="test2" value="test2">test2</option>
<option id="test3" value="test3">test3</option>
</select>
</td>
</tr>
<tr>
<td><label for="message">Message:</label></td>
<td><textarea id="message" name="message" rows="20" cols="120">Enter text here</textarea></td>
</tr>
<tr>
<td></td><td><input type="submit" value="Send!"/></td>
</tr>
</table>
</form></body></html>
---
<?php
$name = $_POST['name'];
$sendTo = $_POST['sendTo'];
$message = $_POST['message'];
switch ($sendTo){
case "test1": $sendTo = "a@b.com";
break;
case "test2": $sendTo = "c@d.com,
e@f.com";
break;
case "test3": $sendTo = "a@b.com,
c@d.com,
e@f.com";
break;
}
$subject = "TEST 1 2 3";
$message = "$message";
mail($sendTo, $subject, $message, "From: test php");
?>
---
כרגע זה לא עובד.. איפה אני מגדיר דרך איזה שרת הוא שולח?
האם אפשר לאחר את שני הקבצים שיצרתי לקובץ אחד?
תודה