Mass Email ?

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Mass Email ?

Post 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
Danoontje
Posts: 34
Joined: Tue Sep 08, 2009 9:15 am

Re: Mass Email ?

Post 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.
User avatar
Aikimaniac
L2j Inner Circle
L2j Inner Circle
Posts: 3048
Joined: Sun Aug 07, 2005 11:42 pm
Location: Slovakia

Re: Mass Email ?

Post by Aikimaniac »

In accounts table is email saved ?
Image
User avatar
daedalus
Posts: 155
Joined: Sun Mar 12, 2006 12:16 pm

Re: Mass Email ?

Post by daedalus »

@Aikimaniac, I've add email column for ACM needs.

Agree with Danoontje :)
Daedalus
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: Mass Email ?

Post 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 :)
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: Mass Email ?

Post by DrHouse »

Take care of php configs, sometimes a php cannot be running for more than a preconfigured interval
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Mass Email ?

Post 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;
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
neo25
Posts: 26
Joined: Sun Jul 09, 2006 7:53 pm

Re: Mass Email ?

Post 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/
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: Mass Email ?

Post 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.
User avatar
Copyleft
Posts: 253
Joined: Fri Feb 01, 2008 9:39 pm

Re: Mass Email ?

Post 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?..
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: Mass Email ?

Post 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.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Mass Email ?

Post 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.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: Mass Email ?

Post 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? :D

BTW looks like now you are concerned on security :) start by not using root
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
User avatar
Aikimaniac
L2j Inner Circle
L2j Inner Circle
Posts: 3048
Joined: Sun Aug 07, 2005 11:42 pm
Location: Slovakia

Re: Mass Email ?

Post by Aikimaniac »

DrHouse wrote:If you dont provide the connection data to the script how are you going to parse the emails? :D

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 :)
Image
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: Mass Email ?

Post by momo61 »

Aikimaniac wrote:
DrHouse wrote:If you dont provide the connection data to the script how are you going to parse the emails? :D

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.
Post Reply