diff --git a/src/server/api/endpoints/i/update_email.ts b/src/server/api/endpoints/i/update_email.ts index b44cf0dffb..e08d1fba05 100644 --- a/src/server/api/endpoints/i/update_email.ts +++ b/src/server/api/endpoints/i/update_email.ts @@ -69,12 +69,14 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { const meta = await fetchMeta(); + const enableAuth = meta.smtpUser != null && meta.smtpUser !== ''; + const transporter = nodemailer.createTransport({ host: meta.smtpHost, port: meta.smtpPort, secure: meta.smtpSecure, - ignoreTLS: true, - auth: meta.smtpUser != null ? { + ignoreTLS: !enableAuth, + auth: enableAuth ? { user: meta.smtpUser, pass: meta.smtpPass } : undefined