Skip to content

Commit

Permalink
Fixes smtp secure port settings (ToolJet#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dainius Lukša authored Oct 14, 2021
1 parent b1bebf0 commit 367617d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 3 additions & 1 deletion server/src/services/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 367617d

Please sign in to comment.