jcreigno / nodejs-mail-notifier

nodejs library to listen incoming mail
MIT License
168 stars 77 forks source link

Connected event isn't working #25

Closed bcompagnat closed 7 years ago

bcompagnat commented 8 years ago

I'm trying to do something when the connection is establish, but the event don't seem to work for me. I'm recieving my mails but this event won't work.

Alternative :

` var notifier = require('mail-notifier');

var imap = { // your configs ...}

notifier = notifier(imap);

notifier.on('mail', function(mail) { // do something.. }

notifier.start();

notifier.imap.on('ready', function() { // You are now connected! });

`

jcreigno commented 7 years ago

Works for me :

var n = notifier(config);
n.once('connected', ()=>console.log('----------------> connected'))
n.start();

Feel free to reopen the issue if needed.