Location: PHPKode > projects > Modular Site Manager > htdocs/lk/members-newsletter.php
<?php
chdir("../");
include "inc/functions.inc.php";
$mysql = new mysql(DB_MAIN);
if(isset($_POST['override']))
{
	$sel = $mysql->select(PRE."members", NULL, "id");
} else {
	$sel = $mysql->select(PRE."members", "active='yes' AND newsletter='yes'", "id");
}
while($a = mysql_fetch_assoc($sel))
{
	$message = str_replace(array("{username}", "{site_address}", "{userprofile}", "{email}"), array($a['username'], SITE_URL, SITE_URL.'Profile/'.$a['username'].'/', $a['email']), stripslashes($_POST['message']));
	mail($a['username']." <".$a['email'].">", "Vouksh.info Newsletter - ".$_POST['subject'], $message, "FROM: Vouksh.info Newsletter <hide@address.com>");
}
$mysql->close();
header("Location: ".$_SERVER['HTTP_REFERER']);
?>
Return current item: Modular Site Manager