You are here: Re: PHP and email « PHP « IT news, forums, messages
Re: PHP and email

Posted by Petr Smith on 11/23/05 18:32

>>Thanks to those who have replied so far, yes our main concern is the
>>smtp server falling over or dying. So to come back to John
>>Nichel's answer:
>>
>> John, have you done this personally and I assume the effects were
>>good?? IE everything ran smoothly?
>
>
> I have done it just as John has described above, though I didn't have 8000
> to send. All went well, no hiccups. A couple of things I would mention is
> that I seem to remember reading somewhere that the sleep() function on
> Windows eats a lot of processor. Not an issue for me since I'm on Linux,
> but worth a mention. And the function John suggested above will take over
> 22 hours to send 8000 emails. Since you say its a one shot deal, its
> probably OK.
>

I don't think the long running script with sleep function is the best
approach to this problem. I would recommend writing the whole queue
somewhere (to database) and run script every 5 minutes, load some not
sent yet e-mails (100), send them and write info (it_was_sent tag) back
to database.

It's always better to not have long running script, you never know what
can go wrong and if it fails somewhere or process is killed or machine
rebooted or something happens, you don't know which emails were sent and
which not. And there's no stupidest thing as sending the same company
newsletter twice to the same client.

Petr

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация