For a task like this, you'd use server-side languages like
ASP/
PHP/
Perl but creating the same in Javascript, I've never seen it.. Since you can't control if the viewer has any settings telling you how their browser should send/treat emails, Javascript is in myoppinion a poor substitute for error checking in this comparison.