fix log messages, formats and emails

Had a couple of bugs, mostly in the TLS SMTP log Handler class. Also improved some error messages and logger formats.