从节点 AWS 开发工具包简单电子邮件服务发送电子邮件时出现 SignatureDoesNotMatch 错误

问题描述

我尝试使用 Node 中的 @aws-sdk/client-ses SDK 发送电子邮件,但我收到:

SignatureDoesNotMatch:我们计算的请求签名与您提供的签名不匹配。检查您的 AWS 秘密访问密钥和签名方法。有关详细信息,请参阅服务文档。

这是我的代码:

const aws = require("@aws-sdk/client-ses");

async function main() {
  const ses = new aws.SES({
    region: "eu-west-3",credentials: {
      accessKeyId: "REDACTED",secretAccessKey: "REDACTED"
    }
  });
  await ses.sendEmail({
    Destination: {
      ToAddresses: ["[email protected]"]
    },Message: {
      Subject: {
        Charset: "UTF-8",Data: "Test email"
      },Body: {
        Text: {
          Charset: "UTF-8",Data: "This is the message body in text format."
        }
      }
    },Source: "[email protected]"
  });
}

main().catch(console.error);

这段代码有问题吗?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)