Forum Moderators: coopster

Message Too Old, No Replies

sending an HTML page via mass mail...

from a simple MySQL DB

         

mcjohnson

11:49 pm on Mar 11, 2005 (gmt 0)

10+ Year Member



friend,

I have a website where people can "join the mailing list" by entering their email address from the home page. THe email address goes into a simple, 1-field db. The field is called "email" and I'd like to write a PHP script to call the entire group of emails, and allow my client to send out a mass email to her list.

In other words, maybe she edits the text on her HTML page with the latest "deals" and hits "send" and the script calls the emails fromn the db and, calls in the HTML page and out it goes.

Am I barking up the wrong tree? I'd like to automate this as much as possible for this client so the PHP works in the background and she is able to keep things very simple on her part. If there is a thread that addresses this task, I'd be interested in seeing it. INitial searches didn't really turn up much.

Many thanks,

Pat

bluedalmatian

8:03 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Your best bet is to use the PHP mail() function to send out the emails, and passinto it the HTML content of the message.

In otherwords a PHP script on the server selects all the addresses from the DB, iterates through them and sends out the message. Probably the best way to feed it the HTML is to create an HTML page on the workstation, then use a form to upload it to the server where it can be read by the script, alternatively, if you dont fancy tackling file uploading, just use an ordinary textarea formfield and copy and paste the HTML source into it. Which ever method you choose you obviously need to restrict access to the PHP script, otherwise anyone could use it to send out spam - the best way to do that is either to hardcode a password into the PHP which you have to enter into the form as well (simplest) or use a .htaccess file to restrict access

sun818

9:44 pm on Mar 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There are many free PHP and mySQL scripts that will automate subscription to the mailing list and sending of broadcast e-mails. It would be easier to install the free script and add your current list to the new mailing list script. Do you have phpMyAdmin? This is a great web based database admin tool. I don't see the point in rolling your own solution when there are reliable tested scripts that are available.

mcjohnson

11:34 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Suns818,

yes- I do have phpmy admin installed on my server...is the mail scripting built in - or some third party application? I'll check it out. I had previosuly done a few searches for "mass subcription email via php" but wit limited success. I'll check out phpMyadmin and see what's built in there. Many thanks, I will keep you posted.

Thanks!

Pat

moheybee

12:39 am on Mar 14, 2005 (gmt 0)

10+ Year Member



Search Google for "PHP Mailing List Managers". The first site that comes up has 143.