Added mail check js to codebase manuall from sam's branch