簡體   English   中英

AWS SES 發送多個 PDF 附件 Nodejs

[英]AWS SES send multiple PDF attachment Nodejs

我正在嘗試發送包含多個 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

到目前為止,上面的代碼正在運行,但是我想發送多個附件。 謝謝你。

就我而言,問題是邊界不匹配,例如:

--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

因此,請注意邊界。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM