PHP: Send Email via cronjob and set amount of email send per mins

后端 未结 3 529
忘了有多久
忘了有多久 2021-01-26 11:12

i have a program which use to send group emails, i set a cornjob per mins for this program, and set execute per 2nd/min, and check if the now time is match to my defined schedu

相关标签:
3条回答
  • 2021-01-26 11:57

    I think you should set this configuration at the application level rather than the cron job level.

    Let's say, cron job should run every minute but the application itself should know howmany e-mails to send when a cron job runs by checking the datetime for the last e-mail is sent, and let's say, send 3 more e-mails and so.

    0 讨论(0)
  • 2021-01-26 11:59

    its only example to said 3 emails per mins actually i want to give user to set the amount of sending email per min/ per hour/ per second

    and i know about the send email program, but what if mutil task doing.. such as 3 newsletter will blast at 20/3/2009 15:15:00; each of those target to 10000pls

    i dun want to save the whole blast list in db, since client may import a email list for 40000 ppls, always timeout when import, even i set the time limit to 2 mins, dun want to take more then that time

    so do u have any sugeestion on the email sending?

    0 讨论(0)
  • 2021-01-26 12:15

    First of all. 10000 emails with 3 per minute will take over 2 days.

    Secondly, the best way to do this is to save the emails to database (to, title, body etc) and then create a script that sends out 3 emails and set the cronjob to run every minute.

    Also check out these questions.

    • Sending bulk email in PHP
    • Sending mass email using php
    • Best way to send 10,000+ emails with PEAR/Mail_Queue
    0 讨论(0)
提交回复
热议问题