Jump to content
xisto Community
Vyoma

Sending Mail To A Mailing List Possibility of sending a newsletter

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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! :DAs I said, thanks!

Share this post


Link to post
Share on other sites

  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.

1064334661[/snapback]


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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
Share on other sites

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 worksNoMore

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

well, this is why TavoxPeru script dont work (i think) and answer to Aka_BarHosting servers and mostly free hosting servers limit massive mailing in PHP or even disable mailing in PHPall this doe to spamers, server, and agine, mostly free servers cant chack every singel user, if he is spaming or not!and if thay will do so, thay will have to read your mail and this is simply WRONG!!i am sure you dont want server admins to read your mail and i dont think this is even posibleanyone here can be a mail spamer without anyone know it, and hackers sometimes use mailing system witch is unsecured and send mail spam with that script that created for privet use/none spam usethose are the main resons why servers limits the mail function or massive mailing!and, now, why mostly free hostings?well, free hostings have register pages or forums, thay are not talking to the user, and the user can use the hosting in anyway he like and when he likebut on paid host, the user PAY for the hosting and dont want it to close, so he will not send spam when he know that server owners can find out and kick him from the serverand that was 60 sec about Hosting Servers and Mail Function :)NoMore

Share this post


Link to post
Share on other sites

well, this is why TavoxPeru script dont work (i think) and answer to Aka_Bar
Hosting servers and mostly free hosting servers limit massive mailing in PHP or even disable mailing in PHP
all this doe to spamers, server, and agine, mostly free servers cant chack every singel user, if he is spaming or not!
and if thay will do so, thay will have to read your mail and this is simply WRONG!!
i am sure you dont want server admins to read your mail and i dont think this is even posible
anyone here can be a mail spamer without anyone know it, and hackers sometimes use mailing system witch is unsecured and send mail spam with that script that created for privet use/none spam use
those are the main resons why servers limits the mail function or massive mailing!
and, now, why mostly free hostings?
well, free hostings have register pages or forums, thay are not talking to the user, and the user can use the hosting in anyway he like and when he like
but on paid host, the user PAY for the hosting and dont want it to close, so he will not send spam when he know that server owners can find out and kick him from the server

and that was 60 sec about Hosting Servers and Mail Function :)

NoMore

Well, I understand and agree with the reasons you expose for hostings to do that to control spamming, but why this situation doesnt happens with the mailman that runs mailing lists??? is there a limit of how many emails one mailing list can have????

Best regards,

Share this post


Link to post
Share on other sites

no limitaion for mailing list becose its a script!server cant control scripts and databasethat "mailman" runs his own server, so he get to set the limitaion, and he put the limitaion to OFF, so he send LOTS of mails witout geting kicked out or blooked on the serverbut u can be smarter than the server easly, learn to use imap, and sent mail with smtp server, than the really apache server mailing limitaion cant take control over your mailin :)i really like to use imap myself :D, may be my next thing to learnNoMore

Edited by NoMore (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.