add smtp mailer; improve structure