From c1d6b736eff8a516e939246c80ed8bbe55f24b23 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 18 Jun 2023 14:59:32 +0200 Subject: [PATCH] Updated the email.ts util --- src/utils/email.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/email.ts b/src/utils/email.ts index 16c8e76..130d6f0 100644 --- a/src/utils/email.ts +++ b/src/utils/email.ts @@ -3,7 +3,8 @@ import { Options } from "nodemailer/lib/mailer"; import * as process from "process"; const transport = createTransport({ - service: process.env.MAIL_SERVICE || "gmail", + host: process.env.MAIL_SERVER || "smtp.gmail.com", + port: parseInt(process.env.MAIL_PORT || "587"), auth: { user: process.env.MAIL_USER || "noreply@licenseapi.de", pass: process.env.MAIL_PASS, @@ -11,7 +12,7 @@ const transport = createTransport({ }); export const sendMail = (options: Options, success?: (info: SentMessageInfo) => void, error?: (msg: Error) => void) => transport.sendMail({ - ...options, from: process.env.USER || "noreply@licenseapi.de", + ...options, from: process.env.MAIL_USER || "noreply@licenseapi.de", }, (err, info) => { if (err !== null && error) return error(err);