jcreigno/nodejs-mail-notifier

Connected event isn't working

Closed this issue · 1 comments

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! });

`

Works for me :

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

Feel free to reopen the issue if needed.