Fixes smtp secure port settings (#1039)

This commit is contained in:
Dainius Lukša 2021-10-14 11:25:09 +03:00 committed by GitHub
parent b1bebf0990
commit 367617d678
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -23,7 +23,7 @@ DEFAULT_FROM_EMAIL=hello@tooljet.io
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_DOMAIN=
SMTP_ADDRESS=
SMTP_PORT=
# DISABLE USER SIGNUPS (true or false). Default: true
DISABLE_SIGNUPS=

View file

@ -15,9 +15,11 @@ export class EmailService {
}
async sendEmail(to: string, subject: string, html: string) {
const port = +process.env.SMTP_PORT || 587;
const transporter = nodemailer.createTransport({
host: process.env.SMTP_DOMAIN,
port: process.env.SMTP_PORT || 587,
port: port,
secure: port == 465,
auth: {
user: process.env.SMTP_USERNAME,
pass: process.env.SMTP_PASSWORD,