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

Error to send email to hotmail address

opened this issue · comments

Hi !

I'm currently using node-sendmail to send emails which don't need any answer. I have tried with my personal address but I have some troubles. So, I hope you can help me :) (it's not necessarily a bug, maybe I'm doing something wrong)

Expected Behavior

Normally, the email should be sent and receive in my personnal mailbox.

Current Behavior

Actually, I have the following error:

mx resolved:  [ { exchange: 'mx1.hotmail.com', priority: 5 },
  { exchange: 'mx4.hotmail.com', priority: 5 },
  { exchange: 'mx2.hotmail.com', priority: 5 },
  { exchange: 'mx3.hotmail.com', priority: 5 } ]
Error on connectMx for:  { exchange: 'mx1.hotmail.com', priority: 5 } { Error: connect ETIMEDOUT 65.55.37.88:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '65.55.37.88',
  port: 25 }
Error on connectMx for:  { exchange: 'mx4.hotmail.com', priority: 5 } { Error: connect ETIMEDOUT 104.44.194.235:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '104.44.194.235',
  port: 25 }
Error on connectMx for:  { exchange: 'mx2.hotmail.com', priority: 5 } { Error: connect ETIMEDOUT 65.55.92.152:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '65.55.92.152',
  port: 25 }
Error on connectMx for:  { exchange: 'mx3.hotmail.com', priority: 5 } { Error: connect ETIMEDOUT 104.44.194.237:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '104.44.194.237',
  port: 25 }
error on connectMx Error: can not connect to any SMTP server
    at tryConnect (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:86:49)
    at Socket.<anonymous> (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:92:13)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:189:7)
    at emitErrorNT (net.js:1280:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
Error: can not connect to any SMTP server
    at tryConnect (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:86:49)
    at Socket.<anonymous> (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:92:13)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:189:7)
    at emitErrorNT (net.js:1280:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Steps to Reproduce (for bugs)

  1. I use this piece of code
const sendmail = require("sendmail")();

exports.sendEmail = function(destinataire){
    return new Promise(function(resolve, reject){
        sendmail({
            from: 'no-reply@alexandrie.com',
            to: destinataire,
            subject: 'validation de votre inscription',
            html: 'Mail of test sendmail ',
        }, function(err, reply) {
            if(err){
                console.log(err);
                reject(err);
            }
            resolve(reply);
        })
    })
};
  1. destinataire is an email address. In my case, this is my personal address with the following form xxx@hotmail.com

Context

I'm trying to send an email to check the validity of an inscription on my website. Now, I'm just trying to send email and receive it. Later, I will provide a special link in the email to validate the inscription.

Your Environment

  • Version used: node-sendmail 1.1.1
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Chrome Version 56.0.2924.87; Node.JS 7.5.0
  • Operating System and version (desktop or mobile): Windows 7 integral edition (64 bits)

Where are you trying to send it from? Ex. Google Cloud, Heroku or localhost?
It sounds like it did work before? If so where was the last known work server or localhost

I work with localhost and this is my first time with node-sendmail. Do you think this is a problem with the firewall ?

Try sending to a Gmail address if you have one. It looks like you were trying to send it to a mx2.hotmail.com live account or a Hotmail. Let me know what happens

I have the same problem. I have tried with my personal gamil address and this is the log:

mx resolved:  [ { exchange: 'alt4.gmail-smtp-in.l.google.com', priority: 40 },
  { exchange: 'alt3.gmail-smtp-in.l.google.com', priority: 30 },
  { exchange: 'alt2.gmail-smtp-in.l.google.com', priority: 20 },
  { exchange: 'alt1.gmail-smtp-in.l.google.com', priority: 10 },
  { exchange: 'gmail-smtp-in.l.google.com', priority: 5 } ]
Error on connectMx for:  { exchange: 'alt4.gmail-smtp-in.l.google.com', priority: 40 } { Error: connect ETIMEDOUT 74.125.28.26:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '74.125.28.26',
  port: 25 }
Error on connectMx for:  { exchange: 'alt3.gmail-smtp-in.l.google.com', priority: 30 } { Error: connect ETIMEDOUT 64.233.187.26:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '64.233.187.26',
  port: 25 }
Error on connectMx for:  { exchange: 'alt2.gmail-smtp-in.l.google.com', priority: 20 } { Error: connect ETIMEDOUT 74.125.130.27:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '74.125.130.27',
  port: 25 }
Error on connectMx for:  { exchange: 'alt1.gmail-smtp-in.l.google.com', priority: 10 } { Error: connect ETIMEDOUT 64.233.163.27:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '64.233.163.27',
  port: 25 }
Error on connectMx for:  { exchange: 'gmail-smtp-in.l.google.com', priority: 5 } { Error: connect ETIMEDOUT 66.102.1.27:25
    at Object.exports._errnoException (util.js:1023:11)
    at exports._exceptionWithHostPort (util.js:1046:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '66.102.1.27',
  port: 25 }
error on connectMx Error: can not connect to any SMTP server
    at tryConnect (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:86:49)
    at Socket.<anonymous> (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:92:13)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:189:7)
    at emitErrorNT (net.js:1280:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
Error: can not connect to any SMTP server
    at tryConnect (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:86:49)
    at Socket.<anonymous> (E:\Cours année 2015 - 2017\Mémoire\mookup\node_modules\sendmail\sendmail.js:92:13)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:189:7)
    at emitErrorNT (net.js:1280:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

I am too facing this issue. It sends mail to corporate address but not to personal Gmail account. Any quick resolution would be highly appreciated.

I have tried sending mails to both my personal Gmail and Hotmail addresses from the domain pointed at my server and there are no issues whatsoever.

My env:
Ubuntu server 14.04
Node version 6.1.0
Sendmail version 1.1.1

I think I have found the problem (thanks to @Geex-Renzo ). I don't use sendmail (I was thinking it was no needed because node-sendmail don't use smtp server).

Before closing this ticket, can you explain why Sendmail (or postix) is needed ?
Thank you very for your help :)