nodemailer + art-template template not found
Posted family-626-77
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nodemailer + art-template template not found相关的知识,希望对你有一定的参考价值。
var nodemailer = require("nodemailer") var template = require("art-template") var fs = require("fs") var data = require("./data") const transporter = nodemailer.createTransport({ host: ‘smtp.163.com‘, port: 465, auth: { user: ‘******@163.com‘, pass: ‘******‘ } }); var sendmail = function () { var html = template(__dirname + ‘/template/index.html‘, data) var option = { from: "*****@163.com", to: "******@163.com", subject: "test", html: html } transporter.sendMail(option, function (error, response) { if (error) { console.log("fail:" + error); } else { console.log("success:" + response.messageId); } }) } sendmail()
以上是关于nodemailer + art-template template not found的主要内容,如果未能解决你的问题,请参考以下文章