Unix Mail Help

I am trying to use Unix shell script to read the content of new Unix emails arriving at my mail box. Its for saving the mail content into a separate file for processing data and inserting data into database

But I don't to which command, or which piece of code to do this. Any help is highly appreciated.

Thanks in advance.