Spaces:
Running
Running
Commit ·
8d937c9
1
Parent(s): 18f4675
fix(email): change default SMTP port and disable connection pooling
Browse filesForce IPv4 connections and disable pooling to debug connection issues.
Use type assertion to resolve TypeScript compatibility with nodemailer options.
src/notifications/email.service.ts
CHANGED
|
@@ -10,9 +10,11 @@ export class EmailService {
|
|
| 10 |
constructor(private readonly configService: ConfigService) {
|
| 11 |
this.transporter = nodemailer.createTransport({
|
| 12 |
host: this.configService.get("SMTP_HOST"),
|
| 13 |
-
port: parseInt(this.configService.get("SMTP_PORT") || "
|
| 14 |
secure: this.configService.get("SMTP_SECURE") === "true",
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
maxConnections: 5,
|
| 17 |
maxMessages: 100,
|
| 18 |
connectionTimeout: 20000,
|
|
@@ -27,7 +29,7 @@ export class EmailService {
|
|
| 27 |
tls: {
|
| 28 |
rejectUnauthorized: false, // Help with some SMTP issues
|
| 29 |
},
|
| 30 |
-
});
|
| 31 |
}
|
| 32 |
|
| 33 |
async sendEmail(
|
|
|
|
| 10 |
constructor(private readonly configService: ConfigService) {
|
| 11 |
this.transporter = nodemailer.createTransport({
|
| 12 |
host: this.configService.get("SMTP_HOST"),
|
| 13 |
+
port: parseInt(this.configService.get("SMTP_PORT") || "587", 10),
|
| 14 |
secure: this.configService.get("SMTP_SECURE") === "true",
|
| 15 |
+
family: 4, // Force IPv4
|
| 16 |
+
pool: false, // Turn off pool to debug fresh connections
|
| 17 |
+
|
| 18 |
maxConnections: 5,
|
| 19 |
maxMessages: 100,
|
| 20 |
connectionTimeout: 20000,
|
|
|
|
| 29 |
tls: {
|
| 30 |
rejectUnauthorized: false, // Help with some SMTP issues
|
| 31 |
},
|
| 32 |
+
} as any);
|
| 33 |
}
|
| 34 |
|
| 35 |
async sendEmail(
|