Click here to Skip to main content
15,846,144 members
Please Sign up or sign in to vote.
2.00/5 (1 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 asp.net.

PLEASE HELP!!!!!!!!!!!!
Posted
Comments
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 asp.net. 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:
http://www.hanselman.com/blog/HowToRunBackgroundTasksInASPNET.aspx[^]
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?

1 solution

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900