var Imap = require('imap'),
inspect = require('util').inspect;
var imap = new Imap({
user: 'mygma...@gmail.com',
password: 'mygmailpassword',
host: 'imap.gmail.com',
port: 993,
tls: true,
tlsOptions: { rejectUnauthorized: false }
});
function openInbox(cb) {
imap.openBox('INBOX', true, cb);
}
imap.once('ready', function() {
openInbox(function(err, box) {
if (err) throw err;
/* ??? */
});
});
imap.once('error', function(err) {
console.log(err);
});
imap.once('end', function() {
console.log('Connection ended');
});
imap.connect();
Would this be more easy if connecting these two modules?
https://npmjs.org/package/imap
https://npmjs.org/package/mail-notifier
if so, can anyone help me to do this?
Thank you in advance! :)