Unanswered: query to send email on given date from the web server
I am working on c#.net project and for backend I am using mysql. My project is desktop application and I had placed my database on web server. In my project, there is one newsletter module where I had assigned customer and date to the greeting which I need to email to the customer on datewise criteria.
My query is that I want that greeting should be emailed to the customer when the date condition meets like birthday reminder.
If any question, if you did not get my point clear than please ask. Its urgent. Please Help!!!
Please give me suggestion and help me to work on these.
In this case here the database cannot send any emails. You will have to develop a process which runs periodically to scan the records and identify which emails need to be sent out to whom with which message.
In this case here I will provide a high level algorithm to explain:
$sql = "SELECT email FROM table WHERE datefield = todaysdate ...";
for each record returned from SQL loop
email person with reminder;
If this is a process that is scheduled to run each day at 00:00 then it should pick up the relevant records and email them.
Remember this is a high level algorithm and not a definitive programming language. So you will need to convert this to whatever language you will use for sending out the emails. For example this could be developed in PHP, Bash, C ....