script to send mail !!

Hi Experts..

i have created a table with the fields,

empid name mailid
1 raja raja@xy.com

and entered the values of all persons who are in that file...

i have a .csv file

date shift1 shift2
6/6/2011 ram raja

Now i want a script that could fetch the data in (input file .csv file) and compare it with the above table to send a mail to specific persons reg their shifts on daily basis

i like you to continue the question from here

I would be grateful if i get replies here... !! Since i was not clear with my question last time..

As long as it's not a new question, but rather a clarification, please do not create a new thread, as this is considered double posting.