diff --git a/packages/nocodb/src/plugins/smtp/SMTP.ts b/packages/nocodb/src/plugins/smtp/SMTP.ts index 74a9600815c..53d2a41e52a 100644 --- a/packages/nocodb/src/plugins/smtp/SMTP.ts +++ b/packages/nocodb/src/plugins/smtp/SMTP.ts @@ -27,8 +27,14 @@ export default class SMTP implements IEmailAdapter { tls: { rejectUnauthorized: this.input?.rejectUnauthorized, }, - ...(this.input?.username ? { auth: { user: this.input?.username } } : {}), - ...(this.input?.password ? { auth: { pass: this.input?.password } } : {}), + ...(this.input?.username || this.input?.password + ? { + auth: { + ...(this.input?.username ? { user: this.input?.username } : {}), + ...(this.input?.password ? { pass: this.input?.password } : {}), + }, + } + : {}), }; this.transporter = nodemailer.createTransport(config);