< ?
ob_start();
$tablo_adi = "";
$tablo_sutun = "";
$mail_sayi_sorgu = mysql_query("SELECT COUNT(*) FROM $tablo_adi");
list($mail_sayi_sonuc) = mysql_fetch_row($mail_sayi_sorgu);
mysql_free_result($mail_sayi_sorgu);
$basla = $_GET["basla"] ? $_GET["basla"] : 0;
$limit = 1;
$bekle = 2;
$konu = "";
$mesaj = "";
$ustk = "From: xxx
$ustk .= "X-Sender:
$ustk .= "X-Mailer: PHP\n";
$ustk .= "X-Priority: 3\n";
$ustk .= "Return-Path:
$ustk .= "Content-Type: text/html; charset=iso-8859-9\n";
$mail_sorgu = mysql_query("SELECT $tablo_sutun FROM $tablo_adi limit $basla,$mail_sayi_sonuc");
$mail_sonuc = mysql_fetch_object($mail_sorgu); mysql_free_result($mail_sorgu);
$mail_adres = $mail_sonuc->eposta;
mail($mail_adres, $konu, $mesaj, $ustk);
echo " Alıcı : $mail_adres
";
echo "Gönderilen : $basla
";
echo "Kalan :"; echo $mail_sayi_sonuc-$basla; echo "
";
if($mail_sayi_sonuc > $basla+$limit){
header("refresh: $bekle; url=index.php?basla=".($basla+$limit));
}
?>
DB den gelen mail listesine aynı anda mail atmak için kullanılır.
Alıntı : Spam için kullanmayın please xD
tr0yan0.blogspot.com
Toplu mail göndermek 2 PHP
Gönderen \x01 zaman: 01:26 0 yorum
Etiketler: mail, php, toplu mail
Toplu mail göndermek PHP
Yaz çiz karala...
Toplu mail göndermenize yarayacak php bir döküman..
Lütfen spam için kullanmayın :D
< ?phpob_start();
$basla = $_GET["basla"] ? $_GET["basla"] : 0; // Kactan baslayacak?
$limit = 5; // Kac tanesıne gonderecek?
$bekle = 2; // Kac sanıye bekleyecek?
$konu = "Test";
$mesaj = "...";
$ustk = "From: xxx
$ustk .= "X-Sender:
$ustk .= "X-Mailer: PHP\\n";
$ustk .= "X-Priority: 3\\n";
$ustk .= "Return-Path:
$ustk .= "Content-Type: text/html; charset=iso-8859-9\\n";
if($dosya = (fopen("mail.txt",'r'))){
while(!feof($dosya)){
$satir = trim(fgets($dosya,50));
if($satir != "") $mail[] = $satir;
}
fclose($dosya);
for($i=$basla; $i<$basla+$limit; $i++){
if($mail[$i] != ""){
echo $mail[$i]."
";
mail($mail[$i], $konu, $mesaj, $ustk);
}
}
echo "
Gönderilen $basla, ".($basla+$limit)." arası toplam ".($basla+$limit)." mail. ";
if(count($mail) > ($basla+$limit)){
echo "Kalan ".(count($mail) - ($basla+$limit))." mail.";
header("refresh: $bekle; url=mail.php?basla=".($basla+$limit)); // Sayfayı yenıle
}
}else {
echo "Hata: Dosya açılamıyor.";
}
?>
Alıntı : Mail.php olarak kaydetmeniz yeterli..
tr0yan0.blogspot.com
Gönderen \x01 zaman: 01:16 0 yorum
Etiketler: mail, php, toplu mail