周期性地发送自动电子邮件周期性、电子邮件

2023-09-06 13:16:28 作者:北顾

我在Windows服务器PostgreSQL数据库。余存储在数据库中的雇员的数据,包括合同到期日。 我想在有效期届满前为每位员工发送一封自动电子邮件30天。 (每个员工都有一个电子邮件帐户)。 什么是做到这一点的最好方法是什么? 我想做到以下几点,你可以请指教,如果它是最好的方式,如果我需要回答的问题:

I have Windows server with PostgreSQL database. I stored in the database employees data including contract expiry date. I would like to send an automatic email for each employee 30 days before the expiry date. (Each employee has an email account). What is the best way to do that? I am thinking to do the following, Could you please advise if it is the best way, and if, I need answer for the questions:

在建的WinForm C#应用程序做的:

访问PostgreSQL的日常(我知道如何处理PostgreSQL的,但如何为每个新的一天(计划任务来吗?)?)

比较机床数据与所有到期日在数据库中

Compare machine date with all expiry date in the database

推荐答案

AS @Middas提出,写一个简单的控制台应用程序将需要调度的应用程序之外的责任。

AS @Middas proposed, writing a simple console application would take the responsibility of scheduling outside the application.

一个简单的控制台应用程序是确定的,计划于无论是Windows调度或第三方调度会怎么做。

A simple console application is OK, scheduled by either Windows Scheduler or a 3rd party scheduler would do.

有关发送电子邮件,你可以

For sending emails, you could

使用.NET提供了发送电子邮件 SMTPClient 命名空间 使用如亚马逊SES 第三方服务 use .net provided SMTPClient namespace to send emails use 3rd party service like Amazon SES
 
精彩推荐
图片推荐