added JS scripts, handling mail sending