Code:
///do all your db connecty stuff
//you'll have a template stored somewhere,
$mail= ' Dear {name}, blah blah';
$q = 'SELECT email, name FROM table';
$rs=mysql_query($q);
$subject='Subject Here';
while($row=mysql_fetch_assoc($rs)) {
$to=$row['email'];
$body=str_replace('{name}',$row['name'],$template);
mail($to,$subjet,$body);
}
Would be thebasic format of it, but there are plenty of existing things you could use outthere/...