Updated code for new version of nodemailer