0

试图攻击。通过nodemailer中的示例使用dpd-email(使用nodemailer)的文件(https://github.com/andris9/Nodemailer#attachments

这只是给了我一个 'attachment-1.bin' 0kb 大小的文件

尝试使用来自 nodemailer 站点的不同帖子示例,但结果相同。

使用 chrome 邮递员

        http://localhost:99/email
        to:"asa@me.me"
        subject: "test"
        text: "test"
        attachments: [
    {filename: "test.tx"', content:"hello world", contentType:"text/plain"} 

]

在此处输入图像描述

4

1 回答 1

0

在 NodeMailer 中,attachments是一个attachment对象数组。不过,在上面的代码片段中,您设置attachments的是对象而不是数组。

直接取自电子邮件消息字段

附件- 附件对象数组

改变

attachments: {
  filename: 'text.bin', 
  content: 'hello world!', 
  contentType: 'text/plain' 
}

attachments: [
  {
    filename: 'text.bin', 
    content: 'hello world!', 
    contentType: 'text/plain' 
  }
]
于 2015-10-23T21:42:47.653 回答