add mail function and improve dbCore