mail class + tests