0

Today I need to write a code which can send a automatic mail once in a day after the 80 days of the password changed. I have already checked the condition that password is 80 days old or not and as of now I have just putted the a message to change the password when the user login, but I also want to send him a mail also, so that the user can get the information even if he doesn't logged in the last 10 days before the password expires(because after 90 days the password will be expired).

I know how to send the mail, I know how to check the condition but I don't have any bit of idea that how to send the mail automatically and for this where should I write code so that the mail will be sent regardless the user logged in or not. I am working on the MVC 4 web application. Please help me with this!!

Thank you in Advance!!

2 Answers2

0

I think you look for "scheduled tasks"

You can try looking here

Best way to run scheduled tasks

Community
  • 1
  • 1
yossico
  • 3,421
  • 5
  • 41
  • 76
0

You can use Quartz.NET to schedule a daily job. This means that once a day in a specific job you check for passwords that are older than 80 days and send the mails accordingly.

Here's a tutorial on how to do it.

L-Four
  • 13,345
  • 9
  • 65
  • 109
  • I tried to implement this using Quartz.Net and follow the steps in tutorial but didn't get the success. And I feel that this tutorial is also not updated. – Surbhi Harsh Jun 04 '15 at 10:56
  • Can anyone please tell me, a step by step way to do this. – Surbhi Harsh Jun 04 '15 at 10:57
  • There are plenty tutorials out there, for example http://www.mikesdotnetting.com/article/254/scheduled-tasks-in-asp-net-with-quartz-net – L-Four Jun 04 '15 at 11:12
  • 1
    Thank You @L-Three. This tutorial is really very easy to understand and I have implemented the actual functionality what I wanted, and all the credit goes to you and this tutorial. – Surbhi Harsh Jun 05 '15 at 07:11