Javascript Node.js NodeEmailer不生成附件内容
我正在尝试使用nodemailer自动化电子邮件。问题是我无法让附件工作。下面是一个示例脚本Javascript Node.js NodeEmailer不生成附件内容,javascript,node.js,nodemailer,Javascript,Node.js,Nodemailer,我正在尝试使用nodemailer自动化电子邮件。问题是我无法让附件工作。下面是一个示例脚本 var mailOptions = { from: 'apples@gmail.com', // sender address to: newClient.a22, // list of receivers cc: managerEmail, // list of receivers bcc: financeEmail, // list of receivers
var mailOptions = {
from: 'apples@gmail.com', // sender address
to: newClient.a22, // list of receivers
cc: managerEmail, // list of receivers
bcc: financeEmail, // list of receivers
subject: newClient.a4 + ' |' + monthofService +' | Revision ID: '+revisionId, // Subject line
html: printoutfile.replace(/(\n)/g, '<br>'),
attachments : [ { // utf-8 string as an attachment
fileName: 'check.txt',
contents: 'checking that some attachments work...'
}]
};
var mailpoptions={
发件人:'apples@gmail.com“,//发件人地址
收件人:newClient.a22,//收件人列表
cc:managerEmail,//接收者列表
密件抄送:financeEmail,//收件人列表
主题:newClient.a4+'|'+monthofService+'|修订ID:'+revisionId,//主题行
html:printoutfile.replace(/(\n)/g,“
”),
附件:[{//utf-8字符串作为附件
文件名:“check.txt”,
内容:“检查某些附件是否工作…”
}]
};
除了连接部件外,所有部件都正常工作。甚至是邮件的文件名
任何帮助都将不胜感激,谢谢它的内容而不是内容。检查NodeEmailer wesite上的示例代码
var mailpoptions={
发件人:'apples@gmail.com“,//发件人地址
收件人:newClient.a22,//收件人列表
cc:managerEmail,//接收者列表
密件抄送:financeEmail,//收件人列表
主题:newClient.a4+'|'+monthofService+'|修订ID:'+revisionId,//主题行
html:printoutfile.replace(/(\n)/g,“
”),
附件:[{//utf-8字符串作为附件
文件名:“check.txt”,
内容:“正在检查某些附件是否工作…”
}]
};
var mailOptions = {
from: 'apples@gmail.com', // sender address
to: newClient.a22, // list of receivers
cc: managerEmail, // list of receivers
bcc: financeEmail, // list of receivers
subject: newClient.a4 + ' |' + monthofService +' | Revision ID:'+revisionId, // Subject line
html: printoutfile.replace(/(\n)/g, '<br>'),
attachments : [ { // utf-8 string as an attachment
fileName: 'check.txt',
content: 'checking that some attachments work...'
}]
};