我在这里的情况。我正在使用 npm 邮件通知模块。它工作正常。但是当登录失败时,我不知道该怎么做。
我的代码是
var imap = {
user: "username@username.com",
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");
});
当登录正确时,这工作正常。但我不能很好地处理错误。发生错误时,我希望错误功能起作用
谢谢