@aws-sdk/client-ses
我尝试在 Node 中使用 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: ["REDACTED@REDACTED.com"]
},
Message: {
Subject: {
Charset: "UTF-8",
Data: "Test email"
},
Body: {
Text: {
Charset: "UTF-8",
Data: "This is the message body in text format."
}
}
},
Source: "REDACTED@REDACTED.com"
});
}
main().catch(console.error);
这段代码有问题吗?
谢谢