node-mail-client
Intro
a email client to receive and send mail
base IMAP and SMTP
Installation
npm install node-mail-client
Usage
// these methods all returned promise// checkAuth will auto invoke and it will check smtp authconst mailClient=let mail= user:`*@gmail.com` // your address pass:`***` // your password imap:'imap.*.com'993 // [host,port,tls] smtp:'smtp.*.com'587 // [host,port,secure] name:'Jack' // your name when send// receivemail// send mail // pass checkAuth checkmailcheck=1 // 0: init 1:pass 2:fail// send or receive
API
receive://@param: {string | (total:number)=>string | null} setNum//string alike '1:10' or '1:*' //total is box messages total send:/** @param:Object* {* to: "any@163.com", // list of receivers* subject: "Hello", // Subject line* text: "Hello world? text", // plain text body* html: "<b>Hello world?</b>", // html body* }*/
example
Here is anDocumention
you could find specify about API
send
receive