Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to send email before 3 days of specified date stored in my database.

my customer table,
id     duedate      email

 1      2011-12-08,   you@you.com

i want to match the id and send mail to the mail address before 3 days of due date.
Posted
Updated 28-Dec-11 23:52pm
v2
Comments
OriginalGriff 29-Dec-11 5:45am    
So what part is giving you difficulties?
Zubair Alie 29-Dec-11 5:54am    
you need to write windows service to read the records from database after specific interval of time.
add another field in table with title "sent" of type boolean. it will help you during query un-sent emails...
sansuna 29-Dec-11 6:08am    
hi guys.my mail want to send automatically.

select duesdate of the id row and check current day of date
+3== day of duedate then send the mail what ever you want else increment the id
 
Share this answer
 
v2
C#
if (System.DateTime.Now.AddDays(3).ToString() == "Database date")
            {
             sendMail();
            }
 
Share this answer
 
v3
check code..

C#
if (System.DateTime.Now.AddDays(-3).ToString() == "Database date")
            {
             sendMail();
            }
 
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