...

View Full Version : Newsletter



dniwebdesign
06-09-2004, 04:10 AM
I am wondering how to send a newsletter to people. I know how to send mail to 1 person but sending it to more than 1 person.

Table
------
newsletter
- firstname
- lastname
- email

That is what my table looks like.

I would like to make it send to everyone listed in the database and possibly have it customized to include their name in places (such as where i put [user]
but don't know how. Can anyone give my some guidence in this process. Thanks.

Spookster
06-09-2004, 04:15 AM
Writing a mailing list application can become a very large project depending on what you need it to do. Unless you really just want to write one I would recommend not reinventing the wheel. I've been recommending this one to my clients for some time now and it works great.

http://www.listmessenger.com/

litebearer
06-09-2004, 04:19 AM
put the data into an array, then loop thru the array


$array = // the data from the database

$count = count($array);
$i = 0;

for ($i = 0; $i < $count; $i ++) (
$name = $array[$i]['name'];
$email = $array[$i]['email'];
// and so on

// define the email message

// the code for sending the email

}


You get the idea

l3vi
06-09-2004, 04:21 AM
ARGHH! Why did this message stay?? Sorry about this post mods... please delete it...

l3vi
06-09-2004, 04:24 AM
Do you know much about PHP? The best way IMO to do this is using loops. Maybe give each email/user in your database an ID number. Put your ID's in numerical order from the person who first subscribes, to the person who last subscribes, to make it easier to give out ID numbers. Then, in your loop, it will call this ID number. Then the script will find the first and last name, and email associated with that ID number.
Im a little busy so I cannot tell you exact code you can use, but I can tell you what you need to research to find out how to do it on your own. And youll learn more ;) Just go to www.php.net , (the best place for PHP learning/referencing) and look up the function for and while. Either of these should work if you use them correctly. Its actually fairly simple..

dniwebdesign
06-09-2004, 06:30 AM
I know a fair bit about PHP and Java Coding (although I don't need Java at all at the moment). I'll try the array and loop one, this seems simple enough, and I have never used an array in PHP before. THanks.

dniwebdesign
06-09-2004, 06:44 AM
put the data into an array, then loop thru the array


$array = // the data from the database

$count = count($array);
$i = 0;

for ($i = 0; $i < $count; $i ++) (
$name = $array[$i]['name'];
$email = $array[$i]['email'];
// and so on

// define the email message

// the code for sending the email

}


You get the idea
$array = // the data from the database
How would I go about getting the information into the array so I can retreive it, I would like to have the fname, lname and e-mail of the user as 1 part of the array.


$array = { Dawson, Irvine, dniwebdesign@sasktel.net
John, Doe, johndoe@thepikes.com
Jay, Semko, hello@jaysemko.com }


Is that correct or how would I go about doing it from a MySQL Database. Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum