发送基于时间的电子邮件的意见和方法

发布于 2024-09-19 10:11:31 字数 311 浏览 4 评论 0原文

我有一个网站,希望每周定期发送一到两次电子邮件。

我知道的一种发送电子邮件的方法是在每个星期四下午 5:30 发送电子邮件,方法是在正确的时间启动 Windows 服务并打开我网站的网页。该页面将是一个隐藏页面,然后它将制作所有电子邮件并将其发送出去!

这是一种有点肮脏的做事方式,但这确实意味着我只需要在我的网站中创建一个新页面,而不需要做更多的事情......

他们是更好的方法吗?我可以制作一个独立的应用程序/命令行程序,它连接到数据库并执行相同的操作,但这需要更多的工作来设置与数据库的连接等等。

每个人对完成此任务的可能方法有何看法?

I have a website and would like to send out emails regularly one or twice a week.

One method I know of sending a email say every thursday at 5:30pm would be to have a windows service start up at the correct time and open a webpage of my website. This page would be a hidden page which then would make all the emails and send them out!

This is a bit of a dirty way to do things but it does mean I simply just have to create a new page in my website and not do alot more...

Is their a better way to do this? I could make a stand alone application/cmd line program which connects to the database and does the same but this would require more work with setting up the connection to the database and more..

Whats everyones opinions on possible methods to do this task?

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

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

发布评论

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

评论(1

妄想挽回 2024-09-26 10:11:31

从安全角度和其他原因来看,我建议将其卸载到通过任务计划程序安排的 Windows 服务或 .NET 应用程序,因为最终它将为您提供比替代方案更高的灵活性、稳定性和安全性。只是给你几个理由。

  1. 如果您的网站增长且电子邮件处理花费的时间超出预期,则无需担心超时。

  2. 无需公开暴露电子邮件群发触发器,恶意用户可能会在不需要时尝试发送电子邮件。

  3. 您将电子邮件功能分离到可以独立运行的自己的组件中,这样,如果您需要更多功能,以后扩展会更容易

From a security standpoint and for other reasons I would recommend offloading this to a windows service or a .NET app that you schedule via Task Scheduler as in the end it is going to give you more flexibility, stability, and security over the alternative. Just to give you a few reasons.

  1. No timeouts to worry about if your site grows and the e-mail processing takes more time than expected.

  2. No need to publicly expose an email blast trigger where a malicious user could try to send e-mails when not needed.

  3. You separate the e-mailing functionality out into its own component that can run on its own, that way if you need more functionality it will be easier to extend later

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