I am in a situation here. I am using an npm mail-notifier module . Its working fine. But i don't know how to do, when the Login is failed.
My code is
var imap = {
user: "[email protected]",
password: "pass",
host: "imap.host.com"
};
notifier(imap).on('mail', function(mail) {
test(mail);
}).start();
notifier(imap).on('error', function(err) {
test(err);
console.log("Error Occured");
});
This is working fine when the login is correct. But I can't handle the error well. When An error occurs, I want the error function to be worked
Thanks
Unfortunately Got the answer
This code done the duty...