PHP 中没有 Windows 任务计划程序的灵活任务计划程序

问题描述

我想使用 PHP 为我必须发送电子邮件的每个任务创建一个任务调度程序。任务调度程序必须灵活。假设每小时发送 1 个电子邮件警报,每 2 天发送另一个电子邮件警报。

我可以知道你们中有人有这方面的经验吗?

下面是我的发送电子邮件代码。但基本上,它应该在发送之前首先检查电子邮件警报是否有时间表。

if (@$messageLoc != ''){
                   
    $header = "From: $headerFrom\r\n";
    $header .= "Cc: $headerCC\r\n";
    $header .= "MIME-Version: 1.0\r\n";
    $header .= "Content-type: text/html\r\n";

    $retvals = mail ($to,$subject,@$messageLoc,$header);

       if( $retvals == true ) {
          $intIDs = implode(",",$arrUpdateSendStatusId);
          echo "Message sent successfully...";
          echo "\n";

       $sqlUpdateNotificationStats = "UPDATE app_notifications SET `status` = 'S',updated_date = '".$dt_Now . "' WHERE id IN (".$intIDs . ")";
   
        $conn->query($sqlUpdateNotificationStats);
                     }     


                    }

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)