how to write a shellscript to send a mail alert to the website user based on license expiration time

hi,

i am very much new to shell scripting i have a requirement that i have to develop a License Renewal Alert system
that has to give a alert mail to the users before 30days of user account expiration, by checking expiration date of the user with the data base, this system will run as cron job

can any one give me suggestions how to do it, waiting for your valuable suggetions