Visa ett inlägg
Oläst 2010-04-19, 23:50 #6
youheardit youheardit är inte uppkopplad
Har WN som tidsfördriv
 
Reg.datum: Oct 2008
Inlägg: 1 168
youheardit youheardit är inte uppkopplad
Har WN som tidsfördriv
 
Reg.datum: Oct 2008
Inlägg: 1 168
jo, men problemet är här att om en email adress blir fel. så hoppar den bara över.. och går till nästa.
PHP-kod:
<?php

$e
=0;
$c=0;
$res mysql_query("SELECT * FROM bkl_emails WHERE status = '1'");
$from "BK Landora <[email protected]>";
$subject "Nyhetsbrev Nr 1, 2010";
$message file_get_contents("mail.html");
$headers "MIME-Version: 1.0\n"
$headers .= "Content-type: text/html; charset=utf-8\n"
$headers .= "From:".$from;
while(
$line mysql_fetch_array($res)){
$to rtrim(mysql_real_escape_string($line['email']));

if (
mail ($to$subject$message$headers)){  
$c++;
}
else {
$e++;
mysql_query("UPDATE `bkl_emails` SET `status` = '1' WHERE `id` = '".$line['id']."'") or die(mysql_error());
}
} echo 
$c." Lyckade & ".$e." misslyckade!";
?>
youheardit är inte uppkopplad   Svara med citatSvara med citat