gpt4 book ai didi

amazon-web-services - 使用 AWS SES CLI 发送电子邮件附件

转载 作者:行者123 更新时间:2023-12-02 03:50:01 25 4
gpt4 key购买 nike

我尝试使用 SES CLI 发送电子邮件附件,但每次邮件到达并打开附件时,我都会在 Adob​​e 中收到错误消息:

could not open the file because it is either not a supported file type or because the file has been damaged.

我使用的命令是:

aws ses send-raw-email --raw-message file:///root/AWS/INSPECTOR/message.json

该文件的内容是:

{
"Data": "From: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afdccac1cbcaddefcad7c2dfc3ca81ccc0c2" rel="noreferrer noopener nofollow">[email protected]</a>\nTo: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="89fbeceae0f9e0ece7fdc9ecf1e8e4f9e5eca7eae6e4" rel="noreferrer noopener nofollow">[email protected]</a>\nSubject: Test email sent using the AWS CLI (contains an attachment)\nMIME-Version: 1.0\nContent-type: Multipart/Mixed; boundary=\"NextPart\"\n\n--NextPart\nContent-Type: text/plain\n\nThis is the message body.\n\n--NextPart\nContent-Type: application/pdf;\nContent-Disposition: attachment; filename=\"report.pdf\";\npath=\"\/tmp\/report.pdf\"\n\n--NextPart--"
}

我看过 http://docs.aws.amazon.com/cli/latest/reference/ses/send-raw-email.html 的页面但我不太能得到正确的语法,所以任何帮助将不胜感激......

最佳答案

附件应以 Base64 编码传递,并在 MIME 中指定 Content-Transfer-Encoding: base64。

这是我之前回答过的帖子的链接: Sending aws cli SES as a file attachmennt

关于amazon-web-services - 使用 AWS SES CLI 发送电子邮件附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45759375/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com