1.1.0 • Published 7 years ago
sendmail-nodemailer v1.1.0
sendmail-nodemailer
Installation
NPM
npm install sendmail-nodemailer --save
Examples
var sendmailer = require("sendmail-nodemailer");
var attachment=[
{
filename: 'xxx', //附件名1
path: 'xxx/xxx/xxx.xx', // 附件路径1
cid : '00000001' //cid可被邮件使用
},
{
filename: 'xxx', //附件名2
path: 'xxxxx/xxxx/xxx.xxx', //附件路径2
cid : 'xxxxxxxx' //cid可被邮件使用
}
];
var options={
service:"xxxx" //服务器名称
port:xxx //端口
secure:false // true for 465, false for other ports
sendmailbox:"xxx@xxx.com" //邮件发送者
sendmailboxpass:"xxxxxxx" //邮箱密码
getemailbox:"xxx@xxx.com" //邮件接收者 可以同时发送多个,以逗号隔开
subject:"xxxxxxx" //邮件标题
mailtext:"hello world" //文本 邮件内容
//mailhtml:"<b>hello world</b><p><img src='cid:00000001'/></p>" //html 邮件内容
attachments : JSON.stringify(attachment)
};
var result = sendmailer(options);