One of the ways that a mailer in vbulletin handles it is to do a mailout of 1,000 at a time, then it displays a next page. Clicking on that then mails the next 1,000, etc...

A manual process perhaps, but seems to work okay. I was thinking though that it woould be good to do something like this but use a text file with all the emails in it, and delete each email addy from the text file as it is sent. That way if the mailout times out it wont resend to those who already have. Just to those in the list.

    Why manual, just get the email-addresses from the db and mail 1000 users. Then re-load the page with the variable as GET containing which email address is next. Do this as many times you need.

    So:

    $next=$_GET['next'];
    if($next==''){ $next=0 };
    
    //run email
    script here and increase next after every mail.
    
    //next
    header("location: mail.php?next=1001");
    

      Hi angus,

      Thank you for the reply.

      I am already using the trick you mentioned i.e send 50 (not 1000) emails at a stretch, than auto refresh the page with different variable i.e database limit and end variable to fetch the email addresses again, this keeps on repeating until all mails are send.

      This is working perfectly no problem at all.

      I want one clarification whether is it ok to concatinate all email addresses as address1,address2,address3 and so on, and put it in To: address of the mail function.

      Will this work?

      I want to do this because I want the bulk email sending a quick process. Although it depends on the file size, but the quicker the better is the requirement.

      Thank you once again for the reply.

      Piyush

        IT should work, but it's not really something you're email receivers will appreciate. You'll publish all they're emails addresses. Better send it BCC or something. 🙂

        And don't spam! (not to me at least)

          Personally I would probably use a loop like the previous author suggested and send 1 at a time rather than file up the mail() with dozens of addresses.

          May not be as efficient, but if you ever decide to do anything with the individual mails it might be better - might also be less likely to time out.

            Hi,

            Thanks for the replies.

            Now, I just want to confirm that should I continue using the auto redirect trick to send mail in part or is there any other trick.

            I have dropped the idea of concatination for To: field in mail().

            Please confirm.

            Thank you.

              I had a similar problem once, and what I did was to kinda make a queue of mail to go out. And I set up a cron job to run a script that would check the queue and mail out a certain number of copies and quit. It would run every few minutes, and it would grab the next address from the database, update the database so the next time through it will get the next address after, then send the mail out, and loop. That way if the script dies in the middle, it will pick up where it left off instead of starting from the beginning or wherever the script last started. But it rarely ever dies. I have it sending 250 mails every 15 minutes and it works well for my newsletter of about 2500 subscribers.

              Each newsletter posting in the table has a "start" value and a "sent" value. Each time through the loop it updates the "start" value, and grabs the corresponding record out of the subscribers table. And when it reaches the end of the subscribers, it sets "sent" to 1 to indicate its done.

                19 days later

                How about using the exec function and running sendmail, queuing the mail rather than dumping it all?

                  Professional PHP4 from Wrox Press has a great section on directly interfacing with your SMTP server to send mail through the protocol itself, without relying on mail (). By running on the protocol level instead of using PHP's high-level API, you can perform large tasks more efficiently.

                  Also, if you're a spammer, I have a great recipe for a bleach cocktail you might enjoy, email me if you're interested!

                    11 days later

                    I am developing a tool to send bulk email but does anyone know where I can get a bulk address db or a list? I can't afford to pay for addresses nor do I want to. If some can help drop me a line at frank_j_tudor@yahoo.com

                    Thanks 😃

                      Write a Reply...