chadxz / imap-simple

Wrapper over node-imap, providing a simpler api for common use cases
MIT License
245 stars 79 forks source link

addFlags() for "\\Seen" ... please help #100

Closed j3g closed 3 years ago

j3g commented 3 years ago

I am having trouble marking an email as READ. I try to set the flag for the UID to "\Seen". Am I doing it wrong or is this a bug.

addFlags([], "\Seen");

async function flagMsg(mailbox, uid, flag) { try { console.log("[flagMsg]", mailbox, uid, flag); const con = await imaps.connect(globs.imapUser); await con.openBox(mailbox); const ret = await con.addFlags(uid, flag); console.log("[flagMsg]", ret); await con.end(); } catch (ex) { console.error(ex); } }

j3g commented 3 years ago

why can't I get the code formatting to work...?