【问题标题】:AWS SES send multiple PDF attachment NodejsAWS SES 发送多个 PDF 附件 Nodejs
【发布时间】:2020-07-03 14:36:48
【问题描述】:

我正在尝试发送包含多个 PDF 附件的电子邮件。如何在 AWS SES nodejs 中做到这一点?

到目前为止,这是我的代码:

From: "test" <no-reply@email.com>\n
To: test@email.com\n
Subject: Test Subject\n
MIME-Version: 1.0\n
Content-Type: multipart/mixed; boundary=\"NextPart\"\n\n
--NextPart\n
Content-Type: text/html; charset=us-ascii\n\n
This is the body of the email.\n\n
--NextPart\n
Content-Type: application/octet-stream;\n
Content-Transfer-Encoding: base64\n
Content-Disposition: attachment; filename=\"attachment.pdf\"\n\n
BASE64 OF PDF HERE
--NextPart

到目前为止,上述代码正在运行,但是我想发送多个附件。谢谢。

【问题讨论】:

  • 您在这方面取得了一些进展吗?我有同样的问题

标签: node.js amazon-web-services amazon-ses


【解决方案1】:

就我而言,问题是边界不匹配,例如:

--NextPart
Content-Type: text/html; charset=us-ascii\n\n
This is the body of the email.\n\n

--NextPart
Content-Type: application/octet-stream;\n
Content-Transfer-Encoding: base64\n
Content-Disposition: attachment; filename=\"attachment.pdf\"\n\n
BASE64 OF PDF HERE

--NextPartBlaBla
Content-Type: application/octet-stream;\n
Content-Transfer-Encoding: base64\n
Content-Disposition: attachment; filename=\"missed-attachment.pdf\"\n\n
BASE64 OF PDF HERE

所以,请注意边界。

【讨论】:

    猜你喜欢
    • 2023-04-07
    • 2018-06-22
    • 2014-12-31
    • 1970-01-01
    • 2017-09-28
    • 2020-09-30
    • 2019-12-07
    • 2022-11-25
    • 1970-01-01
    相关资源
    最近更新 更多