Topic: emailing all forum users
is it possible to email all the users of my forum?
greetz Bas
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 troubleshooting → emailing all forum users
is it possible to email all the users of my forum?
greetz Bas
There is no such feature in PunBB, but writing a small script that does the job is easy.
But i don't know how to write a script like that.........
Here you go. Just put this file in the forum root directory and run it. It will generate a file called mlist.txt containing a comma-separated list of all e-mail addresses in your forum.
<?php
/***********************************************************************
Copyright (C) 2002, 2003 Rickard Andersson (punbb@telia.com)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
require 'config.php';
require 'include/common.php';
if ($cur_user['status'] < 2)
message($lang_common['No permission']);
$fh = fopen('mlist.txt', 'w');
if (!$fh)
exit('Unable to open mlist.txt for writing.');
$result = $db->query('SELECT email FROM '.$db->prefix.'users WHERE id>1 ORDER BY id') or error('Unable to fetch user e-mail addresses', __FILE__, __LINE__, $db->error());
$num_emails = $db->num_rows($result);
for ($i = 0; $i < $num_emails; $i++)
{
$cur_email = $db->result($result, $i);
fwrite($fh, $cur_email);
if (($i+1) < $num_emails)
fwrite($fh, ', ');
}
fclose($fh);
exit('mlist.txt generated.');
thank u man!!!!!!!!!!!!!!!!!
Nice one Kennel!
PunBB Forums → PunBB 1.2 troubleshooting → emailing all forum users
Powered by PunBB, supported by Informer Technologies, Inc.