1.3.0 • Published 4 years ago

node-mail-client v1.3.0

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

node-mail-client

Build Status npm

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 auth
const mailClient=require('node-mail-client')
let mail=new mailClient({
  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
})
// receive
mail.receive(null).then(result=>{
  // do something
}).catch(err=>{
  console.log(err)  
})
// send 
mail.send({ to, subject, text, html }).then(info=>{})
.catch(console.error)

// pass checkAuth check
mail.check=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  
receive('1:*').then()
receive(total=>`1:${total-10}`).then()
receive(null).then()

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
*  }
*/

Here is an example

Documention

you could find specify about API
send
receive

Credits

node-imap
Nodemailer

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago