Answered by:
Send Email on every wednesday at 10.00 AM

Question
-
User22205941 posted
Hi All,
I have a problem to do this task.
I Want to send E-mail to particular users on every wednesday 10.00AM. I have an idea to get list of emails from Database and i know about how to send email. My Problem is, How to send at particular time automatically. I am very well sure to use WCF service. But
- Where i can mention time or interval?
- How to call particular method at specific time?
- If any Excepion occur, How will i manage?
I hope you are understand my requirement.
Monday, January 6, 2014 1:00 AM
Answers
-
User-1509636757 posted
In web, everything works based on request and response. So, Some request is required to initiate some response/action. I understand that you need to send email on every wednesday 10.00AM automatically which is possible if you create some background process like Windows service. Here is some handy articles on how you can create a windows service and install it to execute some process like sending email on some time interval/daily basis:
- Creating a Windows Service in C#
- How in Install Windows Service - .NET C#
- Debugging Windows Services in C# and .NET
- Creating a Windows service in C#
- Sending Automated Emails using C# Windows Service
However, because of any restriction (third party hosting for example; if you are unable to use windows service then you can check this article on how to achieve this: Running a background service in a Web Application (no Windows Service was involved during this process)
Here are some other helper links which discusses how you can do this by writing code in global.asax:
- Simple task Scheduling using Global asax
- Simulate a Windows Service using ASP.NET to run scheduled jobs
- Simple task Scheduling using Global.asax
- Simple task Scheduling using Global.asax : The Official Microsoft ASP.NET Forums
hope it helps./.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 1:48 AM -
User-1662538993 posted
The easiet thing to do is create wcf service and console app. Call wcf service from console app and then schedule console app to run from scheduler to run every wednesday at 10.00 AM.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 9:46 AM -
User2103319870 posted
Hi,
You can try using the open source scheduler for .Net : Quartz.Net.
You can schedule a task which will run every wednesday at 10:00 PM.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 5:47 PM -
User-1623675128 posted
if you have already existing web application and if you want to send mail under that then go for Context.Cache expire settings/Task using threads.
if this is standalone requirement then best thing to do is go for windows service..its all dependent onyour curent technoogy stack as I feel where there are many alternatives.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 11:12 PM -
User22205941 posted
My email could be formatted(bold,italic,image etc...) by user... How do i send with formatting in sql server?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, January 7, 2014 4:44 AM
All replies
-
User-1509636757 posted
In web, everything works based on request and response. So, Some request is required to initiate some response/action. I understand that you need to send email on every wednesday 10.00AM automatically which is possible if you create some background process like Windows service. Here is some handy articles on how you can create a windows service and install it to execute some process like sending email on some time interval/daily basis:
- Creating a Windows Service in C#
- How in Install Windows Service - .NET C#
- Debugging Windows Services in C# and .NET
- Creating a Windows service in C#
- Sending Automated Emails using C# Windows Service
However, because of any restriction (third party hosting for example; if you are unable to use windows service then you can check this article on how to achieve this: Running a background service in a Web Application (no Windows Service was involved during this process)
Here are some other helper links which discusses how you can do this by writing code in global.asax:
- Simple task Scheduling using Global asax
- Simulate a Windows Service using ASP.NET to run scheduled jobs
- Simple task Scheduling using Global.asax
- Simple task Scheduling using Global.asax : The Official Microsoft ASP.NET Forums
hope it helps./.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 1:48 AM -
User-1662538993 posted
The easiet thing to do is create wcf service and console app. Call wcf service from console app and then schedule console app to run from scheduler to run every wednesday at 10.00 AM.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 9:46 AM -
User2103319870 posted
Hi,
You can try using the open source scheduler for .Net : Quartz.Net.
You can schedule a task which will run every wednesday at 10:00 PM.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 5:47 PM -
User-1623675128 posted
if you have already existing web application and if you want to send mail under that then go for Context.Cache expire settings/Task using threads.
if this is standalone requirement then best thing to do is go for windows service..its all dependent onyour curent technoogy stack as I feel where there are many alternatives.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, January 6, 2014 11:12 PM -
User22205941 posted
if you have already existing web application and if you want to send mail under that then go for Context.Cache expire settings/Task using threads.
Ya... I'm using web application. How do i do Context.Cache expire settings/Task using threads?
Monday, January 6, 2014 11:28 PM -
User22205941 posted
I'm using web application. Can i use windows service in web server(like godaddy.com etc...)?
How will i do it?
Monday, January 6, 2014 11:30 PM -
User-1509636757 posted
Can i use windows service in web server(like godaddy.com etc...)?Creating and configuring Windows service option or scheduling a console/exe will only be possible if you have dedicated server. On a thirdparty hosting like godaddy, that will not be possible. I would suggest to check out below alternative:
Here are some other helper links which discusses how you can do this by writing code in global.asax:
- Simple task Scheduling using Global asax
- Simulate a Windows Service using ASP.NET to run scheduled jobs
- Simple task Scheduling using Global.asax
- Simple task Scheduling using Global.asax : The Official Microsoft ASP.NET Forums
hope it helps./.
Monday, January 6, 2014 11:48 PM -
User22205941 posted
What will be the approach to send newsletter on weekly or monthly?
Tuesday, January 7, 2014 12:39 AM -
User-1509636757 posted
Send Email on every wednesday at 10.00 AM OR to send newsletter on weekly or monthly - approach still the same - You will need background process to check constantly using windows service or scheduling exe in windows scheduler or something workaround that is posted earlier with global.asax file.
Tuesday, January 7, 2014 12:47 AM -
User13850534 posted
Have you considered to use database mail option? I think it's better if you don't have a dedicated server.
Tuesday, January 7, 2014 3:27 AM -
User22205941 posted
My email could be formatted(bold,italic,image etc...) by user... How do i send with formatting in sql server?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, January 7, 2014 4:44 AM -
User-1623675128 posted
Ya... I'm using web application. How do i do Context.Cache expire settings/Task using threads?
check this link
http://ramakrishnapathuri.blogspot.in/2013/08/easy-way-ruunimg-background-tasks-in.html
Wednesday, January 8, 2014 3:32 AM