 <?php
include '../../inc/sqlinf.php';
include '../apple.inc';
$recip = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];

$to="";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; ";
$headers.= "charset=iso-8859-1\r\n";

foreach($recip as $rec) {
  $headers .= "Bcc: $rec\r\n";
}

$headers.= "From: $from";



$subject = "$subject";
$body = "$message";

$send_check=mail($to,$subject,$body,$headers);
if ($send_check!=true) {
  die('An error occurred while sending mail.');
}

?>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#FFFFFF" bordercolor="#FFFFFF">
  <tr bgcolor="#000066"> 
	<td width="100%" colspan="2"> <font color="#FFFFFF">&raquo;</font><b><font color="#FFFFFF"> 
	  Mail Sent!</font></b></td>
  </tr>
  <tr> 
	<td bgcolor="#EEEEEE" width="10%" valign="top">&nbsp; </td>
	<td bgcolor="#F9F9F9" width="90%"> 
	  <table cellspacing="1" cellpadding="2" border="5" bordercolor="#FFFFFF" bgcolor="#CCCCCC" width="80%">
		<tr> 
		  <td bgcolor="#FFFFFF" width="25%"> <b><font color="#666666">TO</font></b> 
			: 
			<?php
foreach($recip as $rec) { ?>
			<?php echo "$rec , "; ?>
			<?php } ?>
		  </td>
		</tr>
		<tr> 
		  <td bgcolor="#FFFFFF" width="25%"> <b><font color="#666666">FROM</font></b> 
			: 
			<?php echo $from; ?>
		  </td>
		</tr>
		<tr> 
		  <td bgcolor="#FFFFFF" width="25%"> <b><font color="#666666">SUBJECT</font></b> 
			: 
			<?php echo $subject; ?>
		  </td>
		</tr>
		<tr> 
		  <td bgcolor="#FFFFFF" width="25%"> <b><font color="#666666">MESSAGE</font></b> 
			: 
			<?php echo $message; ?>
		  </td>
		</tr>
		<tr>
		  <td bgcolor="#FFFFFF" width="25%">
			<div align="right"><a href="../mailinglist.php" target="main">Back</a> 
			</div>
		  </td>
		</tr>
	  </table>
	  
	</td>
  </tr>
</table>
