tw-mail
v1.0.9
Published
[![Build Status](https://travis-ci.org/wodog/tw-mail.svg?branch=master)](https://travis-ci.org/wodog/tw-mail) [![Version npm](https://img.shields.io/npm/v/tw-mail.svg)](https://www.npmjs.com/package/tw-mail)
Downloads
4
Readme
tw-mail
trend wood mail module.
install
npm install tw-mail
set up
first, you should create config.js
.
and then, add some config in it, just like below:
module.exports = {
/**
* mail options
*/
mail_opts: {
host: 'smtp.163.com',
port: 25,
auth: {
user: '[email protected]',
pass: 'qjkujfvdzbyhphzg'
}
}
};
usage
var config = require('config');
var tw-mail = require('tw-mail')(config.mail_opts);
var options = {
email: '[email protected]', // 发送邮箱地址
token: '123456', // token
username: 'wodog99', // 用户名
webname: '测试网站', // 网站名
url: 'http://test.com' // 链接地址
}
// 发送密码重置邮件
tw_mail.sendResetPassMail(options, callback);
// 发送验证发邮件
tw_mail.sendValidateMail(options, callback);
// 发送激活邮件
tw_mail.sendActiveMail(options, callback);
response
{
accepted: [ '[email protected]' ],
rejected: [],
response: '250 Ok: queued as ',
envelope: { from: '[email protected]', to: [ '[email protected]' ] },
messageId: '[email protected]'
}
test
npm install
npm test
screenshots
active
validate
passreset