Etki eşit olduğunda e-posta Postpone

1 Cevap php

Bir müşteri için ben kendi web portalı için 4 farklı e-posta ajanları geliştiriyorum.

Ben bir veritabanında saklanır istemcileri (gelecekte binlerce çift) e-postalar bir sürü göndermek gerekiyor. Gönderme gayet iyi, ama e-posta gönderen bir PHP komut dosyası çalışmak istiyorum, ama aynı zamanda önceki e-posta etki saklar ve spam filtreleri önlemek için daha sonra göndermek için bu e-posta ertelemek daha eşit eğer.

I'm going to load that script with cron and I already set_time_limit(0); Code sample available at http://mikaelz.host.sk/php/job_robot.txt

1 Cevap

E-postalar veritabanında zaten.

TIMTOWTDI =. bunu yapmak için birden fazla yolu var.

one possible approach (in pseudo-code):
(a) create a list of objects of PKs (primary keys) with their corresponding e-mail domains;
this could be a list of pairs, of the form:
PK, domain.
(b) create a second, empty list;
(c) order the list from (a) by domain;
(d) send an e-mail the the first item via PK from list (a);
(e) for each subsequent item in list (a), if the domain is the same as
its predecessor, MOVE it from list (a) to list (b),
otherwise send an e-mail via PK from list (a);
(f) continue until list (a) is exhausted;
(g) if there are are items in list (b), MOVE them to list (a)
such that list (b) is empty and list (a) contains the
unsent e-mails.
(h) repeat the above process until list (a) is exhausted
and list (b) simultaneously has zero items.

Saygılarımla / Gerry (Lowry)