guileen / node-sendmail

send mail without setting up a SMTP server

Home Page:http://guileen.github.com/node-sendmail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mail send, but ECONNRESET Error

Biomido opened this issue · comments

Hello,
Great project !

I have a problem with random ECONNRESET errors thrown after mails been successfully sent.
Most of the time this happens, in like 1/6 trys there is no error.

Node version is 9.4

The error message:

        recv mail.ch>221 Bye
        OK: 221 221 Bye

        null
        '221 Bye\r\n'
        send mail.ch>
        fail to connect mail.ch
        Error: read ECONNRESET
            at _errnoException (util.js:1003:13)
            at TCP.onread (net.js:623:25)
        ---------------------------------------------
            at Socket.Readable.on (_stream_readable.js:779:35)
            at /srv/node_modules/sendmail/sendmail.js:145:12
            at Socket.<anonymous> (/srv/node_modules/sendmail/sendmail.js:99:13)
            at Socket.emit (events.js:160:13)
            at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:10)
        ---------------------------------------------
            at Socket.Readable.on (_stream_readable.js:779:35)
            at tryConnect (/srv/node_modules/sendmail/sendmail.js:96:16)
            at QueryReqWrap.callback (/srv/node_modules/sendmail/sendmail.js:103:9)
            at QueryReqWrap.onresolve [as oncomplete] (dns.js:245:10)
        undefined

The used code:

            const sendmail = require('sendmail')();

            sendmail({
                from: 'no-reply@my.domain',
                to:   'account@mail.ch ',
                subject: 'random title',
                html: 'random text'
              }, function(err, reply) {
                console.log(err && err.stack);
                console.dir(reply);
            });

sorry I'm getting around to this late

is that the actual email your sending to? @Biomido