Page 1 of 2
Mass Email ?
Posted: Sun Sep 20, 2009 4:03 pm
by momo61
Hello guys,
Im in need of some support. Just wondering, what is the best way to send an Email to all the email-addresses registered in the "account" table ?
// momo61
Re: Mass Email ?
Posted: Sun Sep 20, 2009 5:20 pm
by Danoontje
make a small while loop in php...this has some downsides tho... make sure u use correct headers. and have decent mailserver to keep up with the loop, if you want a simple code lemme know.
Re: Mass Email ?
Posted: Sun Sep 20, 2009 5:40 pm
by Aikimaniac
In accounts table is email saved ?
Re: Mass Email ?
Posted: Sun Sep 20, 2009 5:43 pm
by daedalus
@Aikimaniac, I've add email column for ACM needs.
Agree with Danoontje

Re: Mass Email ?
Posted: Sun Sep 20, 2009 9:43 pm
by momo61
Danoontje wrote:make a small while loop in php...this has some downsides tho... make sure u use correct headers. and have decent mailserver to keep up with the loop, if you want a simple code lemme know.
Hmm ... I'd like to send am email to 200 persons at a time, and there is a chance that an email will turn up twice or even more times since I allow 1 email for many accounts.
I'd appreciate it if you could share a code for that

Re: Mass Email ?
Posted: Sun Sep 20, 2009 9:45 pm
by DrHouse
Take care of php configs, sometimes a php cannot be running for more than a preconfigured interval
Re: Mass Email ?
Posted: Sun Sep 20, 2009 9:47 pm
by janiii
momo61 wrote:Danoontje wrote:make a small while loop in php...this has some downsides tho... make sure u use correct headers. and have decent mailserver to keep up with the loop, if you want a simple code lemme know.
Hmm ... I'd like to send am email to 200 persons at a time, and there is a chance that an email will turn up twice or even more times since I allow 1 email for many accounts.
I'd appreciate it if you could share a code for that

Code: Select all
SELECT distinct(email) FROM accounts;
Re: Mass Email ?
Posted: Mon Sep 21, 2009 8:09 pm
by neo25
You can use this since it's really easy and all you have to do is plug in the variables like DB name, DB user, Table and Column for users and e-mails. You might have to make a few small code changes to customize it to your needs but I'm sure it would be a small amount if any.
http://www.hotscripts.com/listing/simpl ... der-89526/
Re: Mass Email ?
Posted: Tue Sep 22, 2009 7:16 am
by momo61
neo25 wrote:You can use this since it's really easy and all you have to do is plug in the variables like DB name, DB user, Table and Column for users and e-mails. You might have to make a few small code changes to customize it to your needs but I'm sure it would be a small amount if any.
http://www.hotscripts.com/listing/simpl ... der-89526/
no offence to you, but that seems kinda ... i dont know. It requests my db password and name. I don't think that's necessary. All I want to do is to add the emails and send out one message to all.
Re: Mass Email ?
Posted: Tue Sep 22, 2009 7:27 am
by Copyleft
momo61 wrote:It requests my db password and name. I don't think that's necessary.
Haven't looked at the script yet but... how is it going get the data from the table if the database is password protected?..
Re: Mass Email ?
Posted: Tue Sep 22, 2009 7:38 am
by momo61
Copyleft wrote:momo61 wrote:It requests my db password and name. I don't think that's necessary.
Haven't looked at the script yet but... how is it going get the data from the table if the database is password protected?..
No, i mean, its not necessary to provide my password for simply sending out emails, and I dont want any script to have access to any table of the database.
Re: Mass Email ?
Posted: Tue Sep 22, 2009 8:04 am
by janiii
the only idea of the php script is:
Code: Select all
while ($query = mysql_fetch_array($resultquery)) { $emailinfo=$myemail; $mailto=$query[$table_email]; mail($mailto, $subject, $messagesend , "From:".$fromadmin."\nReply-To:".$fromadmin."\n"); echo 'Mail sent to '.$mailto.'<br>'; sleep($seconds); }
so you just need to have your own array of email addresses, loop through it and send the email.
Re: Mass Email ?
Posted: Tue Sep 22, 2009 12:19 pm
by DrHouse
momo61 wrote:Copyleft wrote:momo61 wrote:It requests my db password and name. I don't think that's necessary.
Haven't looked at the script yet but... how is it going get the data from the table if the database is password protected?..
No, i mean, its not necessary to provide my password for simply sending out emails, and I dont want any script to have access to any table of the database.
If you dont provide the connection data to the script how are you going to parse the emails?
BTW looks like now you are concerned on security

start by not using root
Re: Mass Email ?
Posted: Tue Sep 22, 2009 12:35 pm
by Aikimaniac
DrHouse wrote:If you dont provide the connection data to the script how are you going to parse the emails?
BTW looks like now you are concerned on security

start by not using root
you must first try to explain him how to correctly setup access rights and how to create new user maybe

Re: Mass Email ?
Posted: Tue Sep 22, 2009 2:08 pm
by momo61
Aikimaniac wrote:DrHouse wrote:If you dont provide the connection data to the script how are you going to parse the emails?
BTW looks like now you are concerned on security

start by not using root
you must first try to explain him how to correctly setup access rights and how to create new user maybe

I know how to correctly setup access rights. I use multiple users for various things and scripts, so there's no problem there. What I could do is download all the accounts table, and then delete all the account info except for the email. I'd then install it on my home-PC and send out the email.