简体   繁体   English

每天发送邮件

[英]Send mail daily

I am developing an application where I need to send mail only once daily to the particular persons daily.我正在开发一个应用程序,我只需要每天向特定人员发送一次邮件。 Is there any concept I should know of in node.js?在 node.js 中有什么我应该知道的概念吗? I am using angular 8, node.js and SQL server.我正在使用 angular 8、node.js 和 SQL 服务器。

You can use Node Schedule .您可以使用 Node Schedule 。 npm install node-schedule npm 安装节点计划

This was a google search away Link to node-schedule Document这是一个谷歌搜索链接到节点计划文档

You can use node-cron ,The node-cron module is tiny task scheduler in pure JavaScript for node.js based on GNU crontab.您可以使用node-cron ,node-cron 模块是基于 GNU crontab 的纯 JavaScript 中用于 node.js 的微型任务调度程序。 This module allows you to schedule task in node.js using full crontab syntax.此模块允许您使用完整的 crontab 语法在 node.js 中安排任务。

var CronJob = require('cron').CronJob;
var job = new CronJob('0 0 0 * * *', function() {
  /*
   * This job runs every day at 12:00:00 AM.
   */
  }, function () {
    /* This function is executed when the job stops */
  },
  true, /* Start the job right now */
  timeZone /* Time zone of this job. */
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM