hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Running a Web Hosting Business : PHP Mailing list manager
Reply

Forum Jump

PHP Mailing list manager

Reply Post New Thread In Running a Web Hosting Business Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 05-30-2002, 05:40 PM
jgriff64 jgriff64 is offline
Junior Guru
 
Join Date: Dec 2001
Location: Derby UK
Posts: 225

PHP Mailing list manager


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.



Sponsored Links
  #2  
Old 05-30-2002, 05:42 PM
mwatkins mwatkins is offline
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?

  #3  
Old 05-30-2002, 05:45 PM
jgriff64 jgriff64 is offline
Junior Guru
 
Join Date: Dec 2001
Location: Derby UK
Posts: 225
Info

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.

Sponsored Links
  #4  
Old 05-30-2002, 06:13 PM
mwatkins mwatkins is offline
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.

  #5  
Old 05-30-2002, 06:23 PM
mwatkins mwatkins is offline
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(sendersubjectmessagesql):
    
db.query(sql)
    
result db.fetchall()
    for 
row in result:
        
recipient "%s %s <%s>" % (row.firstnamerow.lastnamerow.email)
        
sendmail(senderrecipientsubjectmessage
In either PHP or Python cases, some sanity and error checking is required.

Sadly I still have to maintain lots of legacy PHP code.

  #6  
Old 05-31-2002, 05:15 AM
jgriff64 jgriff64 is offline
Junior Guru
 
Join Date: Dec 2001
Location: Derby UK
Posts: 225
Thanks

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.

  #7  
Old 05-31-2002, 10:10 AM
mwatkins mwatkins is offline
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

Reply

Related posts from TheWhir.com
Title Type Date Posted
Rackspace Among Cloud Companies on Fortune's "Best Companies to Work For" List Web Hosting News 2014-01-17 11:44:01
Cloud Marketing Company Releases 101 Trust Leaders in Cloud and Hosting for 2014 List Web Hosting News 2013-11-18 11:03:02
SingleHop Makes CRN Solution Provider 500 List Web Hosting News 2013-07-26 14:42:22
Web Hosts, IT Services Firms Make Inc 5000 Fastest Growing Companies Web Hosting News 2012-09-19 16:45:40
Students Contribute to Joomla through Google Summer of Code Program Web Hosting News 2012-05-08 15:22:35


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?