-2

I want to send an email to the admin from my asp.net web application daily at 8:00 am. How to send an email that I know. But how to send it periodically that I doubt. Not through SQL Server. I have written my logic in Application_Start in Global.asax Is this is right?

halfer
  • 19,824
  • 17
  • 99
  • 186
user177689
  • 23
  • 4
  • Check this post out as this might help you: http://stackoverflow.com/questions/542804/asp-netbest-way-to-run-scheduled-tasks – spinon Jul 02 '10 at 04:47
  • This is Too Broad for Stack Overflow, I will vote to close. – halfer Oct 20 '19 at 18:04

2 Answers2

1
  • Use Quartz Scheduler.
  • Or write a windows service that can do this for you,
  • Or register to call your asp.net page that sends the email in Windows Scheduler everyday at 8 AM.
halfer
  • 19,824
  • 17
  • 99
  • 186
this. __curious_geek
  • 42,787
  • 22
  • 113
  • 137
0

You have a page with the logic to send mail but which doesn't send response to the client. Or you can send some response like a success message or whatever you like.

Or instead of a page a web service method would do fine.

Once you have either setup and in production, you need to write a vbscript (*.vbs) which makes a call to the web service or aspx page url. You'll have to schedule this script to run periodically using the windows scheduler (Start -> Run -> Type "tasks" in the run dialog).

Or you'd have to use write a windows service which would do the same thing. You'd have to make use of Timers, HttpWebRequest, and HttpWebResponse classes inside the service.

deostroll
  • 11,661
  • 21
  • 90
  • 161