Made email mechanism work