i want to recieve email and mark email unseen as seen with node-imap. the recieving i have done, but i don't know how to mark email unseen as seen. the API offers a function seems like replace the code var f = imap.fetch(results, { bodies: '' });
with var f = imap.fetch(results, { markSeen : true });
in the example,but it seems doesn't work. what should i do?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Why is `node.js` dying when called from inside pyt
- How to verify laravel passport api token in node /
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
I tried setting mail status to false
imap.openBox('INBOX', false, cb)
but it didn't work at first.But then I changed the data in
body
and set it toHEADER.FIELDS (FROM TO SUBJECT DATE)
it worked. I don't know how is this related but it's working now while the mail box read-only status is false obviously.Non working code:
Working code:
processMessage
so basically results contains the uuid
need to call imap.setFlags([uuids], ['\Seen'], cb) function explicitly to make it mark as read
oh, i'va got solution. it's my fault to open mailbox in read-only mode, that's why i couldn't modify the mail's status.
imap.openBox('INBOX', false, cb);
the second argsfalse
means open mailbox not in read-only mode.Here is a working example for the same.