added email server switch in case of exception (e.g. when a server is down)
minor fixes and smtp