从今天开始的特定日期之前发送电子邮件

发布于 2024-10-01 11:30:03 字数 248 浏览 0 评论 0原文

我如何从现在开始用 C#(Win Forms)发送电子邮件。假设今天是2010年1月1日。现在我在2010年1月10日与医生预约。但我希望需要在3天前(即2010年1月7日)发送一封提醒电子邮件(关于预约)。我有一个电子邮件代码。

我的要求:Visual Studio 2005,C#(vb也可以),WinForms(基于Windows的应用程序)

请帮助我如何实现这一点?

如果需要我提供任何帮助,请告诉我。

谢谢!

How can i send an email certain days from now in C# (Win Forms). Say today is January 1 2010. Now i fix an appointment with doctor on January 10 2010. But i wish that a reminder email (regarding appointment) needs to be sent 3 days before (i.e. January 7 2010). I am having an email code with me.

My requirements: Visual Studio 2005, C# (vb would also do), WinForms (Windows based applications)

Please help me how to achieve this?

Let me know if anything from me is needed.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌酱 2024-10-08 11:30:04

有 2 种方法可以做到这一点

1)编写一个 Windows 服务,它将检查当前日期和您的约会日期并触发一封电子邮件。该服务应该在服务器上运行来执行此操作

2)编写一个 SQL 作业,该作业将运行每天的某个时间(例如:凌晨 2 点)并且 SQL 作业内部有一个存储过程,它将检查日期并调用在服务器中作为服务运行的点网托管代码

2 ways to do this

1 ) Write a windows service which will check the current date and the date for your appointment and trigger an email.The service should be run on the server to do this

2) Write an SQL job,which will be run on everyday at some time (ex: 2 AM ) and inside the SQL job have a stored procedure which will check the dates and call dot net managed code running in the server as a service

清欢 2024-10-08 11:30:04

您要么需要让应用程序一直运行...要么需要某种服务,

您需要一个计时器来每隔几分钟/小时/天检查一次系统时间...并在规定的时间运行您的电子邮件代码。

如果您的应用程序不会持续运行,您将需要一个服务在后台观看,除非您只想在应用程序打开时进行检查。

you either need to have the application running the entire time... or have some sort of service

you need a timer that checks the system time every couple of minutes/hours/days... and at the prescribed time run your email code.

if your app won't be running constantly you'll need a service to watch in the background unless you only want to check while the application is open.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文