首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >dpd-电子邮件/ nodemailer不会附加文件

dpd-电子邮件/ nodemailer不会附加文件
EN

Stack Overflow用户
提问于 2015-10-24 03:59:41
回答 1查看 96关注 0票数 0

试着打招呼。在nodemailer (https://github.com/andris9/Nodemailer#attachments)中通过示例使用dpd-email (其使用nodemailer)的文件

这只给了我一个大小为‘attachment 1.bin’0kb的文件

尝试使用nodemailer站点上的不同post示例,但结果相同。

使用chrome postman

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

]

EN

回答 1

Stack Overflow用户

发布于 2015-10-24 05:42:48

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

直接取自E-mail Message Fields

attachments -附件对象数组

更改

代码语言:javascript
复制
attachments: {
  filename: 'text.bin', 
  content: 'hello world!', 
  contentType: 'text/plain' 
}

代码语言:javascript
复制
attachments: [
  {
    filename: 'text.bin', 
    content: 'hello world!', 
    contentType: 'text/plain' 
  }
]
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33310484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档