如何创建在特定日期发送邮件的计划程序 [英] How To Create a Scheduler which send a mail on particular date

查看:104
本文介绍了如何创建在特定日期发送邮件的计划程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在后台连续调用的功能,用于在发件人在我的网站项目中安排的日期或时间发送邮件到收据。



请帮我。如何设置我的日程安排并不断检查发件人设置的针对性事件的日期和时间?

解决方案

您可以使用 TaskScheduler [ ^ ]



添加对TaskScheduler xx类型库的引用,该库提供对TaskScheduler的访问:

 TaskScheduler.TaskScheduler ts = new TaskScheduler.TaskScheduler(); 



以及任务计划程序API [ ^ ]





祝你好运

Espen Harlinn


我个人不担心代码中的日程安排。 Window'已经有了一个任务调度程序。我会写你的代码来检查邮件是否要发送,并在需要的地方发送。



但我只是执行该代码作为命令使用Windows任务计划程序的行exe。


你好,



我建议创建一个带有计时器对象的Windows服务,这是可以在Windows服务和计时器对象的事件之间建立直接关系。



如果您需要其他组件的帮助,请添加评论。



祝你好运,

JAFC


I need function which is called continuously in the background for sending mail to receipt on date or time which is scheduled by the sender in my website project.

Please help me. How do I setup my schedule and continuously check date and time for pertinence event set by sender?

解决方案

You could use the TaskScheduler[^]

Add a reference to the TaskScheduler x.x Type Library, which provides access to TaskScheduler:

TaskScheduler.TaskScheduler ts = new TaskScheduler.TaskScheduler();


and all the other objects in the Task Scheduler API[^]


Best regards
Espen Harlinn


Personally I wouldn''t worry about scheduling in the code. Window''s already has a task scheduler. I''d write your code to check if a mail is to be sent, sends it where required.

But I''d just execute that code as a command line exe using Windows Task Scheduler.


Hello,

I propose to create a windows service with a timer object, which is possible to establish a direct relationship between the events of the windows service and timer object.

If you need help with your other components, add a comment.

Good luck,
JAFC


这篇关于如何创建在特定日期发送邮件的计划程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆