added mail and automatic log logging capabilities