fix: configuring gmail smtp relay without any authentication
This commit is contained in:
1 file changed
+8
-3
@@ -110,14 +110,19 @@ class EmailService {
|
|||||||
connectionTimeout: 5000,
|
connectionTimeout: 5000,
|
||||||
};
|
};
|
||||||
|
|
||||||
const emailConfig = systemEmailPort === "465" ? baseEmailConfig : {
|
const isSmtps = Number(systemEmailPort) === 465;
|
||||||
|
|
||||||
|
const emailConfig = !isSmtps ? {
|
||||||
...baseEmailConfig,
|
...baseEmailConfig,
|
||||||
name: systemEmailConnectionHost,
|
name: systemEmailConnectionHost,
|
||||||
secure: false,
|
secure: false,
|
||||||
pool: true,
|
pool: true,
|
||||||
tls: { rejectUnauthorized: false },
|
tls: { rejectUnauthorized: false },
|
||||||
auth: null
|
} : baseEmailConfig;
|
||||||
};
|
|
||||||
|
if (!isSmtps) {
|
||||||
|
delete emailConfig.auth;
|
||||||
|
}
|
||||||
|
|
||||||
this.transporter = this.nodemailer.createTransport(emailConfig);
|
this.transporter = this.nodemailer.createTransport(emailConfig);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user