Click here to Skip to main content
14,387,757 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
I had created a web application in which there is a form for creating an event at a specific date and time.Now the client wants to send mail at that date and time to a mail id.I think the only solution to schedule sending a mail at a specific date and time can be accomplished using task scheduler with trigger one time, so that when we create each event there creates a task scheduler.I had searched a lot and can't find any code for creating tasks in task scheduler using

PLEASE HELP!!!!!!!!!!!!
Praveen Kumar Upadhyay 9-Dec-14 9:33am
You better go with Windows Service. Set all details and store in DB when filling the details on Form. Your window service will read data from the database.
Namith Krishnan E 9-Dec-14 23:21pm
how can i create windows service in i think windows service want to create in seperate
Richard Deeming 9-Dec-14 9:46am
Scott Hanselman posted a fairly comprehensive list of options for scheduling background tasks in ASP.NET back in August:[^]
I was about to search for this and you have already posted. Cool. :)
Namith Krishnan E 9-Dec-14 23:25pm
did u get any hint?
Namith Krishnan E 9-Dec-14 23:24pm
is this work even if the application is not running?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You have two options.

1. You can do this by running a Windows Task Scheduler. It is nothing but one Window or Console App, which will be scheduled in your Server. Inside the app, write you email sending code.

You can select the Time(when to run) and Frequency(when to repeat it again) for the Scheduler.

2. Refer - How to run Background Tasks in ASP.NET[^]. You can use Azure WebJobs. If you don't have Azure, then go for the other Background Task managers mentioned by Scott in his blog.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100