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);