You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Nodemailer to send emails in my backend, which is based on a serverless Lambda function. The setup works perfectly in my local environment and even in a cron job running on an EC2 instance. However, when deployed to a Lambda function, it works sporadically but frequently fails with the error SMTP connection timeout exceeded.
INFO Sending Email Error Error: Invalid login: Host Error: timeout exceeded
at SMTPConnection._formatError (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)
at SMTPConnection._actionAUTHComplete (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:1564:34)
at SMTPConnection.<anonymous> (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:546:26)
at SMTPConnection._processResponse (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:969:20)
at SMTPConnection._onData (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:755:14)
at SMTPConnection._onSocketData (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:193:44)
at TLSSocket.emit (node:events:517:28)
at TLSSocket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9) {
code: 'EAUTH',
response: 'Host Error: timeout exceeded',
responseCode: 421,
command: 'AUTH PLAIN'
}
Steps I've Taken:
Increased the connectionTimeout to 4 minutes.
Ensured that the Lambda function's timeout is set to 100 seconds.
Verified that the environment variables (HOST, SMTP_EMAIL, SMTP_PASSWORD) are correct.
Despite these efforts, the issue persists. Emails sometimes send successfully but often fail with a timeout error.
The text was updated successfully, but these errors were encountered:
I have intentionally copied only the relevant parts from my function code. The console log never gets printed. I tried using the callback instead of awaiting the promise. The callback never gets called (there are no errors either).
I'm using Nodemailer to send emails in my backend, which is based on a serverless Lambda function. The setup works perfectly in my local environment and even in a cron job running on an EC2 instance. However, when deployed to a Lambda function, it works sporadically but frequently fails with the error SMTP connection timeout exceeded.
Below is the relevant code:
Error Details:
Steps I've Taken:
Increased the connectionTimeout to 4 minutes.
Ensured that the Lambda function's timeout is set to 100 seconds.
Verified that the environment variables (HOST, SMTP_EMAIL, SMTP_PASSWORD) are correct.
Despite these efforts, the issue persists. Emails sometimes send successfully but often fail with a timeout error.
The text was updated successfully, but these errors were encountered: