Good day!
I should be able to help you with your email management issue. I have successfully created a PHP script that queries a MySQL database, compares the image name in the database with the name of the file on the hard drive, and emails a HTML formatted report with discrepancies. I have also created a PHP application to extract temperatures from 40 servers, display them, and send out email alerts if any server's temperature is over a certain threshold.
So, I look forward to working with you on solving your problem!