Location: PHPKode > scripts > WebsiteMemberManager > members-section/admin/php/extract_emails.php
<?php
$emailbatch=100;
$all_emails = "";
$i_member=0;
$i_emails=0;

$dbc = dbc::instance();
$result = $dbc->prepare("SELECT email FROM wmm_members where subscribed=1");
$rows = $dbc->executeGetRows($result);
if (count($rows)>0)
{
 foreach ($rows as $row)
 {
   $email=$row['email'];
   $i_member++;
   $i_emails++;
   $all_emails.="$email;";
   if ($i_emails==$emailbatch)
   {
    $i_emails = 0;
    $all_emails.="\n\r\n\r";
   }
 }
}

$output_emails= "<form name=\"emails\">";
$output_emails.= "<br><center><b>Outputing emails in batches of $emailbatch </b>(new line following each $emailbatch emails)<br>";
$output_emails.= "<textarea rows=\"8\" name=\"E1\" cols=\"100\">";
$output_emails.="$all_emails</textarea></form><br>Total email addresses: $i_member (from your total members: ".show_total_accounts().")</center>";
include("extract_emails.html");
$rows=null;
$row-null;
?>
Return current item: WebsiteMemberManager