从控制台应用程序发送电子邮件

编程入门 行业动态 更新时间:2024-10-25 03:18:21
本文介绍了从控制台应用程序发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经创建了一个用于发送电子邮件的控制台应用程序,发送时间存储在数据库中. 当当前时间与存储的时间匹配时,如何对控制台应用程序进行编程以使其运行? 请给我一些好的解决方案. 在此先感谢

I have created a console application for sending email, The sending time is stored in database. How to program the console application to run when the current time matches the stored time? Please give me some good solutions. Thanks in advance

推荐答案

您可以使用 System.Threading.Timer 创建计时器,该计时器将在特定的时间间隔内执行您的功能.此关联的功能将检查与数据库时间与当前时间匹配的所有重新记录. 没有计时器的另一种方法是,您可以创建一个任务调度程序,该任务将执行定义的时间间隔并从数据库中获取所有记录.您可以通过任务计划程序执行任何点网应用程序. 希望其中一种解决方案对您有用. Hi, You can use System.Threading.Timer to create Timer that will execute your function with particular time interval. This associated function will check all the recoreds that match the database time with current time. Another way without timer is, you can create one task scheduler that will execute defined time interval and fetch all the records from the database. you can execute any of the dot net application through task scheduler. Hope one of the solution may work for you.

更多推荐

从控制台应用程序发送电子邮件

本文发布于:2023-10-13 00:20:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486279.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   应用程序   发送电子邮件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!