Search for string and send mail

Hi,
I need to find if there is any error in the last few lines of the log file and send a mail accordingly.For example,
Following errors can be logged in the log file.
ERR_1="DB Connection not established"
ERR_2="Server Unloading"
I need to find if these errors are found in the log file and send different mails according to the errors.
How can we do that?

Hi,

Below one can help you..

Thanks
Sha