From daa385b3a84d7aa94055a557c141a54e5b1b9add Mon Sep 17 00:00:00 2001 From: Stefan Probst Date: Thu, 23 May 2024 12:06:41 +0200 Subject: [PATCH] fix: don't require smtp credentials --- src/lib/email.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/email.ts b/src/lib/email.ts index 56bc99e..1f88752 100644 --- a/src/lib/email.ts +++ b/src/lib/email.ts @@ -17,10 +17,13 @@ export function sendEmail(params: SendEmailParams) { host: env.EMAIL_SMTP_SERVER, port: env.EMAIL_SMTP_PORT, secure: false, - auth: { - user: env.EMAIL_SMTP_USERNAME, - pass: env.EMAIL_SMTP_PASSWORD, - }, + auth: + env.EMAIL_SMTP_USERNAME && env.EMAIL_SMTP_PASSWORD + ? { + user: env.EMAIL_SMTP_USERNAME, + pass: env.EMAIL_SMTP_PASSWORD, + } + : undefined, }); return transporter.sendMail({