How to send on a specific day in php?

后端 未结 4 479
情书的邮戳
情书的邮戳 2021-01-22 13:24

I want to a e-cards or something like that. The user can choose the e-cards, after chosen, he must enter the some fields like name(to and from), email(to and from), message and

4条回答
  •  一整个雨季
    2021-01-22 13:54

    This is for *nix. Let's say you have a php script that sends email on a specific day called mailer.php

    
    

    We are going to assume that you already have cron daemon running in the background.

    If you have root access to your machine, then setting up a cron job is simple as editing a file.

    Open up /etc/crontab file and add the following task:

    1 14 * * * root php /path/to/your/scrip/mailer.php
    

    This means, as a root, the mailer.php script will be running daily at 02:01PM. You can change the numbers to whatever you desire.

提交回复
热议问题