This is a snippet I use to front-end validate and process emails. Requires jQuery and Apache