English 中文(简体)
Windows Scheduler OR SQL Server Job for sending out digest e-mails
原标题:

Will be sending out e-mails from an application on a scheduled basis.

I have an EmailController in my ASP.NET MVC application with action methods, one for each kind of notification/e-mail, that will need to be called at different times during the week.

Question: Is Windows Scheduler (running on a Server 2008 box) any better or worse than scheduling this via a SQL Server job? And why?

Thanks

最佳回答

IMHO having scheduler call into the controller and execute the action methods to fire off notifications worked out best. My process (for better of for worst) is as such:

  1. Put the code to call the controller/action in a .vbs file. The action method requires a "security code" that must match a value in the web.config or else it will not execute (my thinking is that this will lessen the chance of some folk hitting the action method with there browser and running the send notification code when it shouldn t be run).

  2. Create a scheduled task in Scheduler to call that file on a regular basis.

  3. In my database, log all notification executions and include an attribute that defines the frequency in which different notification types should go out. This, again, is to lessen the chance of someone sending out notifications when they shouldn t.

Anyhow, this works. The only problem I had was hitting vis https. That didn t work as I believe the task was being challenged to provide some credentials (which it couldn t as it was being run programmatically). Changing it to http worked and imo doesn t create any kind of security risk.

Thoughts? Better way to implement this? I d love to hear anything anyone has to offer.

Thanks

问题回答

I prefer sending emails with a SQL server job. As we already had several jobs running on our SQL server it made sense to stick with this one approach. If we had gone down the scheduled task route we would then of had 2 different task scheduling systems which adds needless complexity. With all scheduled tasks occurring through one system its easy to track and maintain them.





相关问题
Alert email in TFS and power tools

I have a problem with TFS and email notifications. I can not receive any emails from TFS server for work item tracking. I correctly have configured web.config in ...Web ServicesServices in TFS ...

3 notifications instead of one

I m developing simple MVC app in Cocoa/Objective-C. I have a strange issue (or misunderstanding) with notifications and KVO. I have AppController object in MainMenu.xib, hence I implement ...

Notification when laptop is switch on (boot)

I need to know, is that possible to get a notification through email whenever my laptop is switched on or is connected to internet ? An alternative is to get notification when set service Starts on ...

Feedback service for Push notification

I wrote the below script to read the feedback data. But, for some reasons, I am not receiving any data from the server. Can you kindly let me know whats wrong with the script. Also, if you have any ...

热门标签