Custom mailing list (simple one)

Discussion in 'PHP' started by krishmk, May 7, 2009.

  1. #1
    Planning to write a simple mailing list php script.
    The mailing list would serve the following:

    a) Receive email address from new subscribers and store it in a database
    b) Send Emails to Subscribers on a weekly basis (pulling the email ids from database)
    c) Create a facility to unsubscribe

    Just wondering about how many emails the php mail() function can handle.
    I checked the default mailing list (powered by python) offered by my hosting company but for some reason I didnt like it.

    Do you guys have any other suggestions for this?
     
    krishmk, May 7, 2009 IP
  2. !Unreal

    !Unreal Well-Known Member

    Messages:
    1,671
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    165
    #2
    The mail function can only handle one email address. You would have to use a loop.

    I make the full script for you if you like, but at a price.
     
    !Unreal, May 8, 2009 IP
  3. Aaron Sustar

    Aaron Sustar Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you have any experience with PHP and MySQL, this really isn't a big deal.
    a) You need a HTML form where visitors can input their data (name and email address) and a script to store this data in the database. The script only has a query that saves escaped data to the database.
    b) Here you need a cronjob (you set this up in your cPanel) that runs a specific script once a week. That script pulls all the subscribers from the database and sends them emails in a loop. I suggest you something like PHPMailer class to send those emails (I am using my own wrapper for PHPMailer), but the basic mail() script will do just fine in the beginning.
    c) Every mail you send out should be a bit different and should include a link to some script on your website, like unsubscribe.php?subscriber=12345. The number here is ID of the subscriber in your database. When that script gets executed, you simply remove this subscriber from the database (or mark them as inactive).

    I hope this helps you a little ... don't give up. :D
     
    Aaron Sustar, May 8, 2009 IP
  4. usadesi

    usadesi Peon

    Messages:
    296
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if we put a session in data base then it will send the mails in weekly......
     
    usadesi, May 8, 2009 IP
  5. krishmk

    krishmk Well-Known Member

    Messages:
    1,376
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    185
    #5
    Thanks for all your inputs.
    I would be manually sending messages once a week (through a web interface) so I dont need a cron job.
    However I remember reading in a book that mail function is not good for handling huge number of emails (say thousands). If that is true, what should be my alternative?
    Also I expect 3000 to 5000 email subscribers for my particular site.
     
    krishmk, May 8, 2009 IP
  6. fourfingers

    fourfingers Peon

    Messages:
    37
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    phplist ... don't waste your time reinventing the wheel
     
    fourfingers, May 13, 2009 IP