guileen / node-sendmail

send mail without setting up a SMTP server
http://guileen.github.com/node-sendmail
MIT License
559 stars 110 forks source link

Cant send any emails #44

Closed jonathanlundstrom closed 6 years ago

jonathanlundstrom commented 6 years ago

Hello!

I've been using this library for some time and it has worked great but for the past few weeks I haven't been able to get it to send any emails what so ever, no matter what provider I try to send it to.

Error on connectMx for:  { exchange: 'aspmx3.googlemail.com', priority: 10 } { Error: connect ETIMEDOUT 74.125.28.27:25
at Object.exports._errnoException (util.js:953:11)
at exports._exceptionWithHostPort (util.js:976:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
    code: 'ETIMEDOUT',
    errno: 'ETIMEDOUT',
    syscall: 'connect',
    address: '74.125.28.27',
    port: 25 }

This happens on any network I try to use it on.

This is how my code looks:

sendmail({
    from: 'Plant Guardian <plantguardian@conrad.se>',
    to: 'contact@jonathanlundstrom.me',
    subject: 'Ge mig vatten!',
    html: nunjucks.render('email.html', {
        name: sensor,
        moisture: value
    })
}, function(err, reply) {
    console.log('Error occurred, could not send email...', reply);
});

Can you see anything obvious which would cause these errors?

Thanks!

CherryNerd commented 6 years ago

Hi @jonathanlundstrom, I just copied your code and it seems to be working for me.

Can you supply more details?

GeeX-Renzo:node-sendmail-test Renzo$ node app.js 
mx resolved:  [ { exchange: 'aspmx2.googlemail.com', priority: 10 },
  { exchange: 'aspmx3.googlemail.com', priority: 10 },
  { exchange: 'alt1.aspmx.l.google.com', priority: 5 },
  { exchange: 'alt2.aspmx.l.google.com', priority: 5 },
  { exchange: 'aspmx.l.google.com', priority: 1 } ]
MX connection created:  aspmx2.googlemail.com
recv jonathanlundstrom.me>220 mx.google.com ESMTP a5si663038lfg.108 - gsmtp
send jonathanlundstrom.me>EHLO conrad.se
recv jonathanlundstrom.me>250-mx.google.com at your service, [92.111.35.66]
recv jonathanlundstrom.me>250-SIZE 157286400
recv jonathanlundstrom.me>250-8BITMIME
recv jonathanlundstrom.me>250-STARTTLS
recv jonathanlundstrom.me>250-ENHANCEDSTATUSCODES
recv jonathanlundstrom.me>250-PIPELINING
recv jonathanlundstrom.me>250-CHUNKING
recv jonathanlundstrom.me>250 SMTPUTF8
send jonathanlundstrom.me>MAIL FROM:<plantguardian@conrad.se>
recv jonathanlundstrom.me>250 2.1.0 OK a5si663038lfg.108 - gsmtp
send jonathanlundstrom.me>RCPT TO:<contact@jonathanlundstrom.me>
recv jonathanlundstrom.me>250 2.1.5 OK a5si663038lfg.108 - gsmtp
send jonathanlundstrom.me>DATA
recv jonathanlundstrom.me>354  Go ahead a5si663038lfg.108 - gsmtp
GreenPioneer commented 6 years ago

@Geex-Renzo did you use nunjucks too ?

GreenPioneer commented 6 years ago

let us know @jonathanlundstrom if you had any more info

fzamperin commented 6 years ago

I'm with the same problem

mx resolved:  [ { exchange: 'alt4.aspmx.l.google.com', priority: 10 },
  { exchange: 'alt3.aspmx.l.google.com', priority: 10 },
  { exchange: 'alt1.aspmx.l.google.com', priority: 5 },
  { exchange: 'alt2.aspmx.l.google.com', priority: 5 },
  { exchange: 'aspmx.l.google.com', priority: 1 } ]
Error on connectMx for:  { exchange: 'alt4.aspmx.l.google.com', priority: 10 } { Error: connect ETIMEDOUT 74.125.200.27:25
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '74.125.200.27',
  port: 25 }

My code:

sendmail({
  from: 'Teste <eleicao@local.com.br>',
  to: 'fernando@oniq.com.br',
  subject: 'TESTE!',
  html: 'TESTE'
}, function(err, reply) {
  console.log('Error occurred, could not send email...', reply);
});