Answered by:
c# code to run block of code at perticular time every day

Question
-
User-1263702099 posted
Hai,
Am written sendmail() and sendmessage() functions to send mail and messages,this is asp.net web application already hosted in server,But now i need to write the code for sending mail and message at perticular time every day automatically .how to do in c# asp.net.
Saturday, May 7, 2016 8:25 AM
Answers
-
User-1780421697 posted
Fluent Scheduler do this job for you, just need to configure it and it will works for you.
https://github.com/fluentscheduler/FluentScheduler
http://www.hanselman.com/blog/HowToRunBackgroundTasksInASPNET.aspx
Although it can be achieved by several other approaches but that need some extra work to do like having some window service etc.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 7, 2016 9:33 AM -
User2031412921 posted
Hai Nataraj,
refer the below listed links for your reference....
http://www.codeproject.com/Questions/484730/Howplustoplussendplusemailplusdailyplusatplusparti
http://www.c-sharpcorner.com/uploadfile/17e8f6/sending-automatic-mail-through-Asp-Net/
Regards,
meenaravi
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 7, 2016 10:46 AM -
User36583972 posted
Hi NatarajYashash,
From your description, you can try the following suggestions.
1: Use BackgroundWorker
The BackgroundWorker class allows you to run an operation on a separate, dedicated thread. You can refer the following tutorial.
Sending Automatic Mails in ASP.NET:
http://www.c-sharpcorner.com/UploadFile/17e8f6/sending-automatic-mails-in-Asp-Net/
2: Also, you can create a windows service and install it on your server. You can logically schedule the mails to send.
Simple Windows Service Sample:
http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx
Best Regards,
Yohann Lu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, May 10, 2016 10:07 AM -
User-821857111 posted
If you are on a shared hosting plan, you probably can't install Windows Services on the web server. You can either ask your hosting company if they provide a means to schedule tasks, or use something like Quartz.Net: Scheduled Tasks In ASP.NET With Quartz.Net
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, May 10, 2016 10:14 AM -
User-1377768212 posted
Hi,
You can use Windows Service in C# and VB.Net.
Reference :
http://www.c-sharpcorner.com/article/job-scheduling-in-Asp-Net-mvc-with-quartz-net/
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, May 10, 2016 6:30 PM
All replies
-
User-1780421697 posted
Fluent Scheduler do this job for you, just need to configure it and it will works for you.
https://github.com/fluentscheduler/FluentScheduler
http://www.hanselman.com/blog/HowToRunBackgroundTasksInASPNET.aspx
Although it can be achieved by several other approaches but that need some extra work to do like having some window service etc.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 7, 2016 9:33 AM -
User2031412921 posted
Hai Nataraj,
refer the below listed links for your reference....
http://www.codeproject.com/Questions/484730/Howplustoplussendplusemailplusdailyplusatplusparti
http://www.c-sharpcorner.com/uploadfile/17e8f6/sending-automatic-mail-through-Asp-Net/
Regards,
meenaravi
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 7, 2016 10:46 AM -
User36583972 posted
Hi NatarajYashash,
From your description, you can try the following suggestions.
1: Use BackgroundWorker
The BackgroundWorker class allows you to run an operation on a separate, dedicated thread. You can refer the following tutorial.
Sending Automatic Mails in ASP.NET:
http://www.c-sharpcorner.com/UploadFile/17e8f6/sending-automatic-mails-in-Asp-Net/
2: Also, you can create a windows service and install it on your server. You can logically schedule the mails to send.
Simple Windows Service Sample:
http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx
Best Regards,
Yohann Lu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, May 10, 2016 10:07 AM -
User-821857111 posted
If you are on a shared hosting plan, you probably can't install Windows Services on the web server. You can either ask your hosting company if they provide a means to schedule tasks, or use something like Quartz.Net: Scheduled Tasks In ASP.NET With Quartz.Net
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, May 10, 2016 10:14 AM -
User-1377768212 posted
Hi,
You can use Windows Service in C# and VB.Net.
Reference :
http://www.c-sharpcorner.com/article/job-scheduling-in-Asp-Net-mvc-with-quartz-net/
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, May 10, 2016 6:30 PM