|
|
|
|
![]() ![]() |
Jan 3 2006, 04:58 AM
Post
#1
|
|
|
Cosmic Overlord Group: Members Posts: 571 Joined: 26-November 05 From: Denver, Colorado, US Member No.: 9,811 myCENTs:45.66 |
Task: To send an email to a list of email addresses stored in a database
Premise: Page is written in PHP, with the database as MySQL. The email addresses need to be taken from a column of a table in the database which is queried with some "WHERE" clause. The email sent to these addresses is static. Objective: To send a newsletter to the members who have subscribed for the same on a website. Well, there. I have put it as objectively and as clearly as possible. I have searched for the keywords "mail" and "PHP" on this section of the forum, and from what I have seen, it is possible to mail to an address. But is it possible to send it to a list of them? I mean, if I could get the addresses seperated by ';'. Or is there some other way? What I am trying to achieve is to send newsletters. For now, I would be satisfied with a static content. Later I would like to venture into the possibility of dynamic content. But may be for that, we need to handle each address one by one. |
|
|
|
Jan 3 2006, 05:21 AM
Post
#2
|
|
|
Super Member Group: Members Posts: 572 Joined: 25-April 05 From: Nashville Tennessee Member No.: 4,340 |
Here are some links to some free scripts you night find of interest. On of these does not use a database but a textfile.
http://phpmailer.sourceforge.net/ http://www.davelozinski.com/scripts/mail_l...p?1136265340578 This is the one that uses a textfile instead of a database to possibly achieve what you want. http://www.biegelscripts.com/index.php?a=6&t=2&l=0 |
|
|
|
Jan 3 2006, 08:51 AM
Post
#3
|
|
|
Cosmic Overlord Group: Members Posts: 571 Joined: 26-November 05 From: Denver, Colorado, US Member No.: 9,811 myCENTs:45.66 |
Well, Houdini. The first link itself hit the jackpot - or so I think. I still will not be implementing it practically, I just wanted to get my design docs proper before going ahead for the implementation. So, I wanted to see, atleast in theory, if it were possible. I am a bit bad with the searches and could not get anything proper.
The second one is a mailing list one, which I quite extensive, and packaged. It would not be of much use to me. The third one was way overwhelming for me! As I said, thanks! |
|
|
|
Jan 5 2006, 02:33 PM
Post
#4
|
|
|
Super Member Group: Members Posts: 595 Joined: 4-September 04 Member No.: 228 |
QUOTE(Vyoma @ Jan 3 2006, 06:58 AM) But is it possible to send it to a list of them? I mean, if I could get the addresses seperated by ';'. Or is there some other way? What I am trying to achieve is to send newsletters. For now, I would be satisfied with a static content. Later I would like to venture into the possibility of dynamic content. But may be for that, we need to handle each address one by one. You just need to iterate, ie. loop through the list of addresses and call mail() for each. And by this way making the email dynamic such as saying "Hey, [name]!" on the begining is really easy too. Just use a messafe templae of which you will process in the loop, replaceing the keywords such as [user] with the appropriate content from the database. Naturally there are many ways to do it, so use what you feel most comfortable with. Just adding text to beginng and end of the message is easiest route. And since you're working with mail() don't forget to study documentation on how you should build the message headers. It's lot more "professional" to send automatically generated mail with proper headers. If I remember correctly, PHP documentation (or comments) has realyl nice info on headers, including examples. |
|
|
|
Jan 6 2006, 04:17 AM
Post
#5
|
|
|
Cosmic Overlord Group: Members Posts: 571 Joined: 26-November 05 From: Denver, Colorado, US Member No.: 9,811 myCENTs:45.66 |
Come to think of it, Hercco, I think I should go by your method. It is the most straight forward method, that right out missed my mind. Ha! This is fine example of how one gets lost in the complexity and fails to see all simple solutions.
Thanks Hercco. |
|
|
|
Jan 29 2006, 01:12 AM
Post
#6
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 24 Joined: 22-January 06 Member No.: 10,833 |
Hi! I found this Newsletter System, based on TXT files, not MySQL. It is VERRY simple. Here is the instructions:
---------------------------------------------- |### Newsletter System 1.0 L.E. ###| ---------------------------------------------- Leandro Maniezo lemaniezo@ig.com.br TRANSLATION FROM PORTUGUESE-BR TO ENGLISH: Alexandre Cisneiros Filho misteryoshi@gmail.com Introduction ---------- - Put line-by-line the adresses on the file emails_bd.txt. - Set the permitions of the txt files to be writebly. - After sendin, all the adresses who recived the message are stored at log.txt. - If some people dont recive the message, deleta all adresses on the file emails_bd that are in log.txt and send again. Instaling ---------- - Put all the files in a folder on the site and set the permitions to the TXT files. Obs.: NO Javascript allowed. If you want to send images, you need to host them. Just download the attached file!
Attached File(s)
|
|
|
|
Aug 24 2006, 10:17 PM
Post
#7
|
|
|
Super Member Group: [HOSTED] Posts: 805 Joined: 8-April 06 From: Lima - Peru Member No.: 12,579 myCENTs:46.87 |
Hi! I found this Newsletter System, based on TXT files, not MySQL. It is VERRY simple. Here is the instructions: ---------------------------------------------- |### Newsletter System 1.0 L.E. ###| ---------------------------------------------- Leandro Maniezo lemaniezo@ig.com.br TRANSLATION FROM PORTUGUESE-BR TO ENGLISH: Alexandre Cisneiros Filho misteryoshi@gmail.com Introduction ---------- - Put line-by-line the adresses on the file emails_bd.txt. - Set the permitions of the txt files to be writebly. - After sendin, all the adresses who recived the message are stored at log.txt. - If some people dont recive the message, deleta all adresses on the file emails_bd that are in log.txt and send again. Instaling ---------- - Put all the files in a folder on the site and set the permitions to the TXT files. Obs.: NO Javascript allowed. If you want to send images, you need to host them. Just download the attached file! Thanks dude, a lot of time i waste searching something like this, is very simple, and also it demostrates me what i was doing bad in my script. best regards, |
|
|
|
Nov 11 2006, 08:51 AM
Post
#8
|
|
|
Member [ Level 2 ] Group: Members Posts: 53 Joined: 11-November 06 Member No.: 17,170 |
i havnt readed what you all wrote but my way is to put the mails in an array and send it in a while of a simple mail function, that way ppl cant see who wlse the mail sent to
- you can create a log file to see how much it send and match it with mails so you can see how it works NoMore |
|
|
|
Nov 12 2006, 08:56 AM
Post
#9
|
|
|
Super Member Group: [HOSTED] Posts: 805 Joined: 8-April 06 From: Lima - Peru Member No.: 12,579 myCENTs:46.87 |
i havnt readed what you all wrote but my way is to put the mails in an array and send it in a while of a simple mail function, that way ppl cant see who wlse the mail sent to - you can create a log file to see how much it send and match it with mails so you can see how it works NoMore Well, i use a database to store my mailing list and its about 3000 records right now, and to send it i do the same thing as you, but i noticed that this doesnt work because no mail is send and also i test it with a little list of 10 records, so i gonna try the use of an array instead maybe this way it works. Best regards, |
|
|
|
Nov 12 2006, 05:38 PM
Post
#10
|
|
|
Member - Active Contributor Group: Members Posts: 87 Joined: 4-November 06 Member No.: 16,990 |
some question to Administrators it is about Mailer i have PhpMailer and i dont know why, every time when im uploading it to hosting and using it for my needs, hosting prividers tellingmi to delete script and also ur account wll be deleted!!! can anyone answer me? why they doing so? im not spamer im just using it for like send News to members or for more ellection!
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th December 2008 - 12:05 PM |