mscdex / node-imap

An IMAP client module for node.js.
MIT License
2.17k stars 382 forks source link

Is there any demo for Gmail setLabels? Thanks #854

Closed fanguangjian closed 3 years ago

fanguangjian commented 3 years ago

Additional Connection instance methods (seqno-based counterparts exist):

setLabels(< MessageSource >source, < mixed >labels, < function >callback) - (void) - Replaces labels of message(s) with labels. labels is either a single label or an array of labels. callback has 1 parameter: < Error >err.

fanguangjian commented 3 years ago

// change the Label for the email imap.setLabels( attrs.uid, 'Label--AA', (err)=>{ if(err){ console.error(err); } })

fanguangjian commented 3 years ago
 // change the Label for the email
                        imap.setLabels( attrs.uid, 'Invoice', (err)=>{
                            if(err){
                                console.error(err);
                            }   
                        })