require_once("../conn.php");
require_once("access.php");
include_once("LeftStyles.php");
if(isset($_POST[s1]))
{
//get the subscribers info
$q1 = "select * from yellow_agents where news = 'y' ";
$r1 = mysql_query($q1) or die(mysql_error());
while($a1 = mysql_fetch_array($r1))
{
$to = $a1[email];
$subject = $_POST[subject];
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/$a1[NewsletterType]; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
if($a1[NewsletterType] == "plain")
{
$message = strip_tags($_POST[message]);
$message .= "\n\n========================\nTo unsubscribe, use this link:\n";
$message .= "http://$_SERVER[HTTP_HOST]/realestate/u.php?id=$a1[AgentID]";
}
else
{
$message = $_POST[message];
$message .= "