<?
$ile=120;
$sql->connect($host, $db_user, $db_pass, $db);// Połączenie z bazą
$sql->query("SELECT * FROM uzytkownicy");
$num=$sql->numRows();//
$post_pages = ceil($num/$ile); $strona=$_GET['strona'];
{
$strona = 1;
}
elseif( $strona == 0 )
{
$strona = $post_pages;
}
while($strona<=$post_pages) {
$strona++;
$sql->query("SELECT * FROM uzytkownicy LIMIT ".(intval($strona) - 1
) * $ile.",$ile"); while($row = $sql->fetchArray())
{
$header="From: $adresemailr\n";
$header .= "MIME-Version: 1.0rn";
$header .= "Content-type: text/html; charset=charset=ISO-8859-2rn";
$subject=iconv("UTF-8","ISO-8859-2", $_POST['temat']);
$tresc=$_POST['tresc'];
$tresc=iconv("UTF-8","ISO-8859-2", $tresc);
mail($row['email'], $subject, $tresc, $header); }
echo"<meta http-equiv=\"Refresh\" content=\"0; url=index.php?akcja=wyslij&strona=$strona\">"; }
if($strona==$post_pages) {
header("Location:index.php?akcja=wyslano"); }
?>
Witam mam taki kod jak wyżej i jest to newsletter, który ma wysyłać maile do użytkowników etapami ale nie działa tak jak potrzeba, co robię nie tak?
I jeszcze jedno ile maili powinno się wysyłać za jednym razem, żeby nie obciążać serwera?
pozdrawiam
Ten post edytował zak293 29.11.2008, 16:19:21