How to automatically send email at a certain time ASP.NET

10,672

Solution 1

For scheduling tasks I always recommend Quartz.NET. However, you should know that there are certain issues when you try to implement scheduler in asp.net application (in my opinion it is better to implement it in windows service). If you implement it in asp.net application remember about application pool idle time (set it to high value or disable automatic pool recycling) since pool must be active when the scheduler needs to execute the task.

Solution 2

You should create a windows service which will do the job

Share:
10,672

Related videos on Youtube

Ronaldinho Learn Coding
Author by

Ronaldinho Learn Coding

Updated on July 12, 2022

Comments

  • Ronaldinho Learn Coding
    Ronaldinho Learn Coding almost 2 years

    Situation: I need to send notification emails every Monday at 9 a.m to all employees, remind them to due the last week report.

    I basically know how to "send email in ASP.NET" (I implemented the contact us form on our website, so "sending email service" basically will be executed when people hit submit button) but I had a hard time to figure out how to make it automatically execute at a certain time, maybe I need a scheduler or something like that, I don't use any database here?

    Somebody who have done it before could give a right direction?

  • Ronaldinho Learn Coding
    Ronaldinho Learn Coding over 10 years
    Thanks I will research about Windows Service
  • Ronaldinho Learn Coding
    Ronaldinho Learn Coding over 10 years
    OK, I googled before asking this question and Windows Service seems to be a good solution, I will give it a shot. I expected that I can find some detailed directions in here but maybe I need get my a** up and do it :D, Thanks!