A simple email function that can be call from anywhere in your code, it also send an attachment.