试着打招呼。在nodemailer (https://github.com/andris9/Nodemailer#attachments)中通过示例使用dpd-email (其使用nodemailer)的文件
这只给了我一个大小为‘attachment 1.bin’0kb的文件
尝试使用nodemailer站点上的不同post示例,但结果相同。
使用chrome postman
http://localhost:99/email
to:"asa@me.me"
subject: "test"
text: "test"
attachments: [
{filename: "test.tx"', content:"hello world", contentType:"text/plain"}
]

发布于 2015-10-24 05:42:48
在NodeMailer中,attachments是attachment对象的数组。不过,在上面的代码片段中,您将attachments设置为对象而不是数组。
attachments -附件对象数组
更改
attachments: {
filename: 'text.bin',
content: 'hello world!',
contentType: 'text/plain'
}到
attachments: [
{
filename: 'text.bin',
content: 'hello world!',
contentType: 'text/plain'
}
]https://stackoverflow.com/questions/33310484
复制相似问题