fixed transaction handling - removed em.flush, added error handling, added emailing
smtp.properties