LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Sending mass emails to a list of users - how? (https://www.linuxquestions.org/questions/programming-9/sending-mass-emails-to-a-list-of-users-how-132374/)

W1pEout[64] 01-07-2004 08:46 AM

Sending mass emails to a list of users - how?
 
Well, I am working on a web-page I did using the language php.Well, because the server is already up, but theirs no pages to view, I simply created a site where visitors can submit their e-mail addresses to be informed about the launch of the page.Now, I am sorta getting close to completion of the site, but now there is the question:
How do I send a mass-email to all the users stored in my MySQL db?Simply copy and paste all the addresses (which might take forever) or is there any better way?
Also, I had the idea to include a "Hello, <usernamewhichwassubmittedonthepagetogetherwiththeaddres>..." at the beginning of the email.How would I do this?
In advance, Thank you for your help!:D

jtshaw 01-07-2004 08:56 AM

If you plan on sending e-mails to these people on a regular basis I suggest getting mailman up and running on your machine. It'll read a mysql db for a subscriber list. Otherwise I would just right a small shell script to pull all the address out, throw them in the to: part of an email, and envoke sendmail or a sendmail wrapper on the whole thing, cause nobody wants to do that manually.

W1pEout[64] 01-07-2004 08:59 AM

I guess Ill try that!

Electric_Blue 01-07-2004 04:41 PM

This can be done with a php script that yanks the addresses out of a db. If you are new to php and mysql it can be a little daunting at first, but very worthwhile to learn.

(warning: very basic overview)

1) connect to your database
2) yank the variables out of the db and stick them into an array
3) loop through the array and build the email (of which the body could be called from an include) During the loop you will insert the variable in the array into the to: section of your mailheader. Then loop again selecting the next value in the array. Loop until array is finished.

Without going into extreme depth, I'll say this is not an extremely easy process, but the code you write will be re-usable and the experience invaluable for your future custom apps.

If you can do this, you can figure out how to do anything with php + mysql.

W1pEout[64] 01-08-2004 11:22 AM

Thanks for the help! :)
Me luvs this forum, no "Newbie-haters" here! :D


All times are GMT -5. The time now is 04:47 PM.