Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: email system

  1. #1
    New to the CF scene
    Join Date
    May 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    email system

    Hi,
    I need some help with coding with mail().
    I have an sql database with 3000 records, emails of users that have signed up for my newsletter.
    Due to restrictions imposed by my host provider, I cannot send one message to more than 30 records, thus I have a major problem with managing my newsletter.
    So, what I need help with is a script that divides the 3000 records by 30, than send 100 messages delayed by 30 seconds let's say.
    Help would be highly appreciated.
    Thank you.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,466
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Find out the "exact" specifications of your host's email rules.
    Some limit not only by the hour, but by the day.

    Tell us for sure what the specs are. Otherwise use a paid newsletter host
    other than your webhost. That actually might be the best way, but it will
    cost you money.

  • #3
    New Coder
    Join Date
    Sep 2011
    Posts
    80
    Thanks
    0
    Thanked 13 Times in 12 Posts
    MailChimp give you a free allowance of 2000 subscribers with 12,000 emails a month so if you're hitting limits it's the way to go.

    Otherwise if you're limited by rate and are not capped, you'd be best setting up a cron job which fires every couple of minutes and takes 30 records at a time and sends off emails.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,466
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    You can add a new column to your MySQL table called 'timesent INT(12)'

    You query the table looking for the first 30 of them that have a
    timestamp out of the range you're looking for. After sending those 30,
    you update those 'timesent' fields to the current timestamp: time()

    When you query again, those 30 won't be in your query results.

    Repeat until no more results are found.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •