non-oop javascript email setup