
05-30-2002, 05:40 PM
|
|
Junior Guru
|
|
Join Date: Dec 2001
Location: Derby UK
Posts: 225
|
|
Hi all, I am looking for a good php mailing list manager. Does any one have any suggestions.
Thanks in advance
__________________
www.38h.com - Windows Hosting, Resellers and Dedicated
www.iistalk.net Windows only forum.
|

05-30-2002, 05:42 PM
|
|
Web Hosting Master
|
|
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
|
|
To run a single list? To run multiple lists? To offer to vhost clients?
|

05-30-2002, 05:45 PM
|
|
Junior Guru
|
|
Join Date: Dec 2001
Location: Derby UK
Posts: 225
|
|
Thanks for the quick response. Sorry for the lack of info.
Originally to run a single list, to send announcements to our customers.
Will need to be able to import addresses or intagrate into current database.
Thanks again.
__________________
www.38h.com - Windows Hosting, Resellers and Dedicated
www.iistalk.net Windows only forum.
|

05-30-2002, 06:13 PM
|
|
Web Hosting Master
|
|
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
|
|
If you already have your list of customers in a database, I'd just write a small mailing function. A form, a mail function, and away you go.
Unless you have thousands of names to mail to, you don't need to do much more than that.
For example:
You have a database with
firstname
lastname
email
send_mail (True or False)
PHP Code:
function sendmail($from,$to,$subject,$message) {
$pipe=popen("/usr/sbin/sendmail -t -i -r \"$from\" -f \"$from\" ","w");
if (!$pipe)
return false;
fputs($pipe,"Return-path: <$from>\n");
fputs($pipe,"From: $to\n");
fputs($pipe,"To: $to\n");
fputs($pipe,"Reply-To: $from\n");
fputs($pipe,"Subject: $subject\n");
fwrite($pipe,$message);
return !pclose($pipe);
}
// main
// take the results of a form and post it to everyone with send_mail = "Y"
// this is more or less working code however you'll need to sub your own 'query' function or deal direct with MySQL PHP calls
// your form will have text field "subject" and text area field "message" within it
// this is a quick from memory effort, your mileage may vary
$db = mysql_connect($dbhost,$dbuser,$dbpassword);
mysql_select_db($db) or die();
$sql = "select firstname, lastname, email from users
where send_mail = 'Y' ";
$result = @mysql_query($sql,$db);
$nrows = mysql_num_rows($result);
for ($i=0;$i<$nrows;$i++) {
$r = mysql_fetch_array($result);
$to = "{$r["firstname"]} {$r["lastname"]} <{$r["email"]}>";
sendmail($from, $to, $subject, $message);
}
And there you go. A few minutes work. The above code may have the odd little problem, but that's all the time I have for this. If useful, terrific, and if not, perhaps someone else will take it and run.
|

05-30-2002, 06:23 PM
|
|
Web Hosting Master
|
|
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
|
|
And for my Python evangelism brownie points of the day, just having to recall a few PHP code snippets reminds me why I am happy that all my web work is now in Python. One is busy and full of nasty extra delimiters, superfluous characters ({} $ ; etc), while the other is clean and easy to read.
PHP Code:
# this is python, not php:
def mail_users(sender, subject, message, sql):
db.query(sql)
result = db.fetchall()
for row in result:
recipient = "%s %s <%s>" % (row.firstname, row.lastname, row.email)
sendmail(sender, recipient, subject, message)
In either PHP or Python cases, some sanity and error checking is required.
Sadly I still have to maintain lots of legacy PHP code.
|

05-31-2002, 05:15 AM
|
|
Junior Guru
|
|
Join Date: Dec 2001
Location: Derby UK
Posts: 225
|
|
Thanks mwatkins, for your time. It is very kind of you. Best Regards.
__________________
www.38h.com - Windows Hosting, Resellers and Dedicated
www.iistalk.net Windows only forum.
|

05-31-2002, 10:10 AM
|
|
Web Hosting Master
|
|
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
|
|
You are very welcome. I don't know if you have any PHP programming experience but even (especially?) if not, I encourage you to try.
Excellent on-line or Windows help file documentation, complete with user experiences and tips, is available here:
http://www.php.net/docs.php
Good luck,
Mike
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|