cleaning up my ugly code; added nodemailer for smtp/sendmail node.js email client functionality