1. cliveportman
  2. /code
  3. /download-mailing-list-from-expressionengine-as-csv-file

Download mailing list from ExpressionEngine as CSV file

Slap this baby in a template and download the resulting .csv file…

<?php
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename="mailing-list.csv"');
?>
{exp:query sql=”select email from exp_mailing_list where list_id = ’2′ order by email asc”}
    email@domain.com
{/exp:query}