Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor email not working - Error: getaddrinfo ENOTFOUND

Tags:

meteor

My meteor is currently running on my localhost.

I added the meteor email package

meteor add email

In server/server.js I added (my password has a ton of special characters (@#$%^&), if that makes any difference):

process.env.MAIL_URL="smtp://myusername%40gmail.com:[email protected]:465/"; 

and then in the same file I added:

Email.send({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Meteor Can Send Emails via Gmail",
  text: "Its pretty easy to send emails via gmail."
});

Nothing gets sent. I get this in my Meteor console:

W20140607-11:37:24.449(8)? (STDERR) 
W20140607-11:37:24.452(8)? (STDERR) /home/wdi2p2/.meteor/tools/6f23056589/lib/node_modules/fibers/future.js:206
W20140607-11:37:24.453(8)? (STDERR)                         throw(ex);
W20140607-11:37:24.459(8)? (STDERR)                               ^
W20140607-11:37:24.466(8)? (STDERR) Error: getaddrinfo ENOTFOUND
W20140607-11:37:24.468(8)? (STDERR)     at Object.Future.wait (/home/wdi2p2/.meteor/tools/6f23056589/lib/node_modules/fibers/future.js:326:15)
W20140607-11:37:24.469(8)? (STDERR)     at smtpSend (packages/email/email.js:94)
W20140607-11:37:24.469(8)? (STDERR)     at Object.Email.send (packages/email/email.js:155)
W20140607-11:37:24.470(8)? (STDERR)     at app/server/server.js:3:7
W20140607-11:37:24.471(8)? (STDERR)     at app/server/server.js:10:3
W20140607-11:37:24.474(8)? (STDERR)     at /home/wdi2p2/Workspace/WDI/VLP/home-photo-pros/.meteor/local/build/programs/server/boot.js:155:10
W20140607-11:37:24.474(8)? (STDERR)     at Array.forEach (native)
W20140607-11:37:24.475(8)? (STDERR)     at Function._.each._.forEach (/home/wdi2p2/.meteor/tools/6f23056589/lib/node_modules/underscore/underscore.js:79:11)
W20140607-11:37:24.475(8)? (STDERR)     at /home/wdi2p2/Workspace/WDI/VLP/home-photo-pros/.meteor/local/build/programs/server/boot.js:82:5
W20140607-11:37:24.476(8)? (STDERR)     - - - - -
W20140607-11:37:24.477(8)? (STDERR)     at errnoException (dns.js:37:11)
W20140607-11:37:24.477(8)? (STDERR)     at Object.onanswer [as oncomplete] (dns.js:124:16)
=> Exited with code: 8

What am I doing wrong here?

Update:

This is the code that is responsible for ENOTFOUND

    it('times out on invalid host', function (done) {

        Sntp.time({ host: 'error', timeout: 10000 }, function (err, time) {

            expect(err).to.exist;
            expect(time).to.not.exist;
            expect(err.message).to.equal('getaddrinfo ENOTFOUND');
            done();
        });
    });

So I guess that the host is timing out for some reason?

like image 271
fuzzybabybunny Avatar asked Dec 14 '22 22:12

fuzzybabybunny


1 Answers

getaddrinfo ENOTFOUND is usually a DNS error (address not found)

It may be your password that is confusing what the domain may be.

Do you have an @ by any chance in your password? Try URL encoding it (password only).

like image 139
Tarang Avatar answered Jan 13 '23 11:01

Tarang