Monday, 8 May 2017

imap credentials not working when listening to new mail event using node mail-notifier2 module

var notifier = require('mail-notifier');   
    var imap = {
           username: "siddharthsogani1",
           password: "MYGMAILPASSWORD",
           host: "imap.gmail.com",
           port: 993, // imap port 
           secure: true // use secure connection 
    };

notifier(imap).on('mail',function(mail){console.log(mail);}).start();

I am trying to listen to new mail event in my gmail inbox. I am using node mail-notifier2 module to do so (as shown in code snippet above). However, I am not able to authenticate.

When I am using above code I get error:-'uncaughtException: Timed out while authenticating with server' and when I am passing tls: true in imap object then I get uncaught exception: 'uncaughtException: self signed certificate in certificate chain'. Please let me know where I am wrong and what should I do to make this work?



via Siddharth Sogani

No comments:

Post a Comment