From 74635c17c8a614d6ecbfae77ee7e9f77873c4850 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Wed, 24 Nov 2021 18:25:23 -0700 Subject: [PATCH] Added better mail logging --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index c8e2608..73a1287 100644 --- a/index.js +++ b/index.js @@ -39,9 +39,10 @@ app.post('/', async (req, res) => { else from = 'Anonymous' // Send email + let mail_res; try { console.log(`Sending email from ${from}...`) - await mailer.sendMail({ + mail_res = await mailer.sendMail({ from: from, to: process.env.MAIL_TO, subject: req.body['subj'], @@ -50,7 +51,7 @@ app.post('/', async (req, res) => { } catch (err) { return res.sendStatus(500) console.error(err) - } + } console.log(`Sent email ${mail_res.messageId}`) // hcaptcha failed } else return res.sendStatus(403)