diff options
author | Walter Bolles <mail@wjbolles.com> | 2025-03-14 19:06:52 -0400 |
---|---|---|
committer | Walter Bolles <mail@wjbolles.com> | 2025-03-14 19:06:52 -0400 |
commit | bc1399175a2601e44a4eda5b28dd3c30772d6575 (patch) | |
tree | 35a8a87c18fc0346387361ead0ebfe75d7561b78 | |
parent | da15a6ec744281c6ae2b970c72d45b93f8a75109 (diff) |
Fix SMTP auth
-rwxr-xr-x | src/routes.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/routes.js b/src/routes.js index 49718ff..1c132ca 100755 --- a/src/routes.js +++ b/src/routes.js @@ -52,19 +52,20 @@ if (config.general.mail_service) { sendEmails = true; break; case "nodemailer": - nodemailerTransporter = nodemailer.createTransport({ + const nodemailerConfig = { host: config.nodemailer?.smtp_server, - port: config.nodemailer?.smtp_port, - secure: false, // true for 465, false for other ports - }); + port: Number(config.nodemailer?.smtp_port) || 587, + }; if (config.nodemailer?.smtp_username) { - nodemailerTransporter.auth = { + nodemailerConfig.auth = { user: config.nodemailer?.smtp_username, pass: config.nodemailer?.smtp_password }; } + nodemailerTransporter = nodemailer.createTransport(nodemailerConfig); + nodemailerTransporter.verify((error, success) => { if (error) { console.log(error); |