Fix:nodemailer transport object only use secure: true when port is 465 #2765

This commit is contained in:
advplyr 2024-04-25 18:04:02 -05:00
parent 00bc50c02d
commit bd1309b680

View File

@ -105,6 +105,10 @@ class EmailSettings {
host: this.host,
secure: this.secure
}
// Only set to true for port 465 (https://nodemailer.com/smtp/#tls-options)
if (this.port !== 465) {
payload.secure = false
}
if (this.port) payload.port = this.port
if (this.user && this.pass !== undefined) {
payload.auth = {