How to send emails via cron job usng PHP mysql

前端 未结 2 1246
感动是毒
感动是毒 2020-11-27 06:48

i managed to send multiple emails (check here).i am stuck with sending automated emails via cron.

This is what i need - while the admin send emails, i store the mes

2条回答
  •  佛祖请我去吃肉
    2020-11-27 07:36

    Just write a normal PHP script -- make one that will work if it's launched directly from the browser. Then schedule that very same PHP file to run in cron, using this as a guide:

    http://www.unixgeeks.org/security/newbie/unix/cron-1.html

    Basically, using the values at the beginning, specify the schedule (minute, hour, day of week, day of month, etc.). Then set the user it runs as, which is likely to be "apache" or whatever your web server daemon is running under. Then set the "command" that cron is running to be php php_email_script.php (where "php_email_script.php" is the name of your PHP file.

提交回复
热议问题