如何从Asp.net C#发送自动消息? [英] How to send Automatic Messages from Asp.net C#?

查看:86
本文介绍了如何从Asp.net C#发送自动消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,我需要通过从数据库中获取数据来自动发送消息/短信。



我可以通过选择或点击发送消息来自asp.net页面的按钮,但消息应该发送,即使我不会登录页面。



实际上它是我需要在日期发送的时间表匹配。

I am developing a project where i need to send Message/SMS automatically by fetching the data from database.

I am able to send messages by selecting or clicking the button from asp.net page but the messages should be send even i would't login the page.

Actually its a Schedule that i need to send when the date matches.

推荐答案

查看我过去的答案 - asp.net中的计时器控制 [ ^ ]。
See my past answer - Timer control in asp.net[^].
Quote:

对于发送邮件,您可以创建控制台应用程序并添加到Windows任务计划程序。

您可以选择开始日期和时间,并设置重复频率。



它会当时间自动触发到达间隔并重复自身。

For sending mails, you can create Console Application and add that to the Windows Task Scheduler.
You can select the Date and Time when to start and also set the repetition frequency.

It would automatically trigger, when the time interval is reached and repeat itself.


ASP.Net不是正确的工具,因为代码不会一直运行。它只在有人访问页面时运行。



您需要创建一个Windows应用程序,控制台应用程序或Windows服务才能执行此操作。
ASP.Net is not the right tool to do this because code does not run all the time. It only runs when someone visits a page.

You'll want to create a windows app, console app, or windows service to do this.


这篇关于如何从Asp.net C#发送自动消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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