Click here to Skip to main content
15,895,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Day all,

Please some one help me out here.

I have a database column for datecreated. I have written simple script to get the total number of days, that is comparing the datecreated to datetime.today, if the difference is >= 30 then send a mail to the user

The script is:
C#
string datecreated = Convert.ToString(Session["datecreated"]);
            DateTime dt3 = DateTime.Parse(datecreated);
            DateTime dt4 = DateTime.Today;
            TimeSpan tp = dt4.Subtract(dt3);
            int bs = tp.Days;

The script gives the total days.
How can the server automatically send email to the user if tp.days > = 30?
Especially when the user is not logged in.

Thanks
Posted
Updated 8-Sep-13 0:50am
v3
Comments
BillWoodruff 9-Sep-13 3:45am    
There are many articles on how to send e-mail here on CP, articles that will show you how to do it from ASP.NET, or WinForms, or whatever. Just search.

1 solution

you can write a console application which keeps on running and checking the db with some formula for getting email addresses based on date time(-30) days, and then send emails to them..
this will be a continuous running application like a job ..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900