如何编写自动调度电子邮件的代码Asp .net c# [英] how to Write codes for auto scheduling email Asp .net c#

查看:104
本文介绍了如何编写自动调度电子邮件的代码Asp .net c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Quote:

我创建了一个从Global.cs自动发送电子邮件的Web服务。我使用参考代码项目参考模拟WS进行自动安排的电子邮件服务,它每隔2分钟从我的Gmail帐户发送电子邮件到另一个Gmail帐户。现在,我希望在此成功的基础上走得更远。我想拥有UI界面,用户可以在其中选择要发送的内容,发送内容,发送时间,开始日期和结束日期,并使其工作。为此,我有几个收件人的下拉列表,课程broucher,发送时间,两个日历的开始日期和结束日期的网络表格。



用户可以选择在这个UI上。然后,用户可以配置为每天发送自动电子邮件。我为ScheduledEmailID(PrimaryKey),收件人外国ID,发送电子邮件,发送时间(数据类型时间(7)),开始日期(datetype DateTime)和结束日期(数据类型DateTime)创建了一个表。我将用户输入保存到MS Sql中。然后,我将把它们发送到Global.cs,编写业务逻辑,以便编写日期时间来运行自动调度。是否建议这样做?请问任何想法。我还想确保服务应该在结束日期停止运行。目前,此2分钟间隔发送电子邮件没有停止选项。请adivse。非常感谢。



我用这篇文章作为我的参考点使用ASP.NET模拟Windows服务来运行预定作业 [ ^ ]。

I have created a web services that do auto emailing from Global.cs. I used the reference Code Project Ref for Simulate WS for auto scheduled email services, and it is sending email every 2 minutes from my gmail account to another gmail account. Now, I want to go further based on this success. I want to have UI interface where user can choose whom to send, what to send, send time, start date and end date in web form and make them work. For this, I have several drop down lists for recipients, course broucher, send time, two calendars for start date and end date in web form.

User can make selectoin on this UI. Then, user can configure to send daily automatic email. I have created a table for ScheduledEmailID(PrimaryKey), Recipient Foreign ID, Email to Send, Send Time(datatype Time(7)), Start Date(datetype DateTime) and End Date(datatype DateTime). I will save user input into MS Sql. Then, I will fectch them to Global.cs, write business logic which is to compate datetime to run auto scheduling.Is it advisable to do it? Any idea, please. I also want to make sure that the service should stop running at End Date. Currently, this 2 minutes interval sending email has no stop option. Please adivse. Thank alot.

I used this article as my point of ref Simulate a Windows Service using ASP.NET to run scheduled jobs[^].

推荐答案

这篇关于如何编写自动调度电子邮件的代码Asp .net c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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