require_once('/path/to/phpmailer.php');
// this is your list of emails
// in particular, this assumes email only
$emails = file_get_contents('email.txt');
$pmail = new PHPMailer();
// set most of your settings here
// (from, subject, content, etc.)
// you can also spin content,
// randomize subject lines, etc.
// if you want
// approach #1
foreach($emails as $email){
$pmail->AddAddress($email);
if(!$pmail->Send()){
// send error to log
}else{
// log success
}
}
// approach #2
// looks more "natural"
// and more efficient (only one call to the server's mailer program)
foreach($emails as $email){
$pmail->AddBCC($email);
}
if(!$pmail->Send()){
// log the error
}