Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending Periodic Mail according to user's Setting in ASP.net?

in my web-application I want to send mail for users according to pre selected periods by themselves.
for example: 1 HTML Mail Per 3days to user 01 and 1 HTML Mail Per 20days to user 02

how can I perform that? any resources? I can send mail by my app from My Gmail Account to any mail addresses in my tables but i dont know how to send it automatically in a period of time.(i use C# and SQL Express)
Help me out!

like image 778
Mehdi Avatar asked Dec 07 '22 05:12

Mehdi


1 Answers

I found the Solution.
according to my search we have 3 ways to handle that:

  1. working with SQL Server to send mail notification in periods of time.(or this)
  2. using Windows service and Creating Timer object and checking the time with it.

but in ways 1 and 2 we should access to server and we need dedicated hosting server to for example installing WinService on it. so it does not work in a sharing Host space we usually use. So I Found the best way as you see:

  3.  Simulating Windows Services Using ASP.NET Caching For Scheduled Jobs.

the link above is a terrific solution. So there is no need to work out-side of our web application.

like image 196
Mehdi Avatar answered Dec 10 '22 01:12

Mehdi