I would like to create a module in node.js that will inform me (with an
event) if a new mail arrives (using IMAP). Until now i have used IMAP
module example code but can anyone help me for the next step? Thanks a lot.
var Imap = require('imap'),
inspect = require('util').inspect;
var imap = new Imap({
user: '[email protected]',
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! :)
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.