Send confirmation or error email

Partly using this to play with github (so do as you wish with it ;) ) - but I've added functionality for the script to give email feedback depending on what happened. If the file is successful an email is sent back to the magic sender to tell them such, if it hasn't an email is sent to a specified error email address to notify the main user. This is all on an on/off switch in the config file. Tested and works.