In certain scripts, how do they do the whole "send <this many> users emails per page"? Like if you one want to send emails to only 50 users at a time, how do you do that?

    Hi,

    Are you Newbie....??

    The number of post you have and still this question..

    Simple Run a For loop to desire number in your case run it 50 times....

    But You must not do that as it will mark your server as spam server..because if more than few mail are send from one script and that two regularly than there is every chance that your mail server is mark spam and also even for first attempt of script all mails will go to BULK folders....

    SO PLEASE DON'T SPAM

      First off all, this isn't for spam, its to send out a newsletter to subscribed users. Second, you don't even know what you are talking about, being that you didn't answer the question at all. Third, if you got nothing good to say, don't say anything at all.

      Anyways, putting the drama aside, here is my question simplified:

      I have about 350 subscribed users, I make a email form, put in my message, and hit send, how can I make it so that the mailer only mails to 25 users at a time, so the server load doesn't shoot up and break through the roof.

      I hope y'all can understand better now. Really need help on this, thanks.

        Do you want all 350 emails to be sent out eventually? How quickly? When do you want the emails sent?

        You could have a script that gets started (somehow; it depends on when you want the script to run and how you want to indicate that it should run) that goes through all 350 emails, and [man]sleep[/man]s for a while every 25 users or so. You'd need to reset the script's timeout when you do this, of course. Or even sleep for a shorter period and send one email at a time, and have them sent out in a steady dribble instead.

        Are you using SMTP directly, or are you going through mail()? If the latter, you really should use the former instead: a lot of the server load would be the repeated connecting and disconnecting from the mail server.

        The alternative would be to remember somehow how far through the list you are and cross addresses off as you go (the list! There's an idea! Save a file listing the destination addresses; when you send a bunch of emails, delete their addresses from that list.) Run an at job (a one-off cron job) that starts the script, if after it's sent out its batch of emails there are still more to go in the list, it registers an at job to run itself again in x minutes' time.

          Write a Reply...