I have a table with the below fields and data
Month - Year - Month/Year - Submitted - DueDate
Jan 2012 Jan/2012 1 25/01/2012
Feb 2012 Feb/2012 1 25/02/2012
March 2012 March/2012 1 25/03/2012
April 2012 April/2012 1 25/04/2012
May 2012 May/2012 0 25/05/2012
June 2012 June/2012 0 25/06/2012
Now I want to know how to write an automatic script which will run on 20th to 25th of every month and should send a email to firstname.lastname@example.org of the current month if the value in the status field is 0, otherwise if the value is 1 it should not send the email.
e.g the current month is MAY 2012 and the value of Submitted is 0, so an email should be sent out to email@example.com. Please note that the script sould only send an email of the current month and the records are pre entered into the table of the complete year from Jan to Dec.