smpt-mail
Send email use smpt transport and support ejs render html
Install
npm install smpt-mail
Usage
const email = ; const config = smtpHost: 'smtp.exmail.qq.com' smtpUser: 'shiqiang.tang@jiukangyun.com' smtpPass: processenvNODE_SMTP_PASS from: 'shiqiang.tang@jiukangyun.com' to: 'i@tsq.me' subject: 'hello world' htmlStr: '<p>hello <a href="https://github.com"><%=user.name%></a></p>' htmlContext: user: name: 'tsq' ; ;
Config
param | type | description |
---|---|---|
smtpHost | string | your smtp server host |
smtpUser | string | your smtp server email address |
smtpPass | string | your smtp server email password |
from | string | the e-mail address of the sender |
to | array | comma separated list or an array of recipients e-mail addresses |
cc | array | comma separated list or an array of recipients e-mail addresses |
subject | string | email subject |
htmlStr | string | email content string that will be rendered by ejs |
htmlContext | object | ejs render context |