Who says you have to be online to run this script?
So you have to process a bajillion messages? It's not like you have to press [enter] between each message.
Put your list of subscribers in a text file that is held on the machine. Use your web form only for updated versions of the file. Then write a script (say "send-newsletter"), that sends out the message to each person. When you run it, run it as "send-newsletter &", i.e., run it in the background. Bingo! You script just took two seconds to run.
You can log off, and if the silly thing takes six hours to complete, it doesn't matter, you don't have to hang around.
There are a number of other things you can do. You can write a logfile to a password-protected URL on your site, to watch the script trundle along.
You could also divide the script in two, if disk space is not a problem. Firstly, you write a script to generate all the emails. (Note, placing more than 1000 files in a directory is not a good idea, find some logical way to split them up among multiple directories). This script will probably be pretty fast, short enough for you to (want to) hang around and check the results. When everything is hunky-dory, you run a second script whose sole purpose is to take all those generated email messages and feed them to your local MTA, taking as long as it takes. That part you might want to run in the background and you go away and do something else.
This approach is nice, because it gives you one more barrier from doing something tremendously stupid, like accidently mailing the subscribers a love-letter from your significant other. You can give a couple of the messages a final once-over, before committing to sending them out.
--In reply to Re: Speeding up a mailing list script
by grinder
in thread Speeding up a mailing list script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |