Open stefanolaru opened 1 year ago
Did you find a solution?
I tracked this issue down to EventEmitter.emit('error', errorObject)
turning into an unhandled rejection when there are no handlers, see below:
The workaround is to do something like:
const smtpClient = new SmtpClient(...);
(smtpClient as any as EventEmitter).on('error', () => {});
Hi,
Thank you for writing this client, it's really helpful.
Running it in an AWS Lambda (node 18) and occasionally it throws ECONNRESET. Some SMTP servers seem to terminate the connection when I attempt the MAIL command.
For some reason I'm not able to catch the ECONNRESET, it doesn't trigger the on('error') listener, nor with try/catch.
Any idea how to handle this type of exception?