我有一个问题,我无法从新的AWS环境中which were introduced a month ago.发送电子邮件
所有旧版本都工作正常(例如us-east-1,us-west-2,eu-west-1)。 但是如果我想从一种新环境中发送邮件,例如eu-central-1,我只收到错误消息:
The request signature we calculated does not match the signature you provided. Check your AWS Secret access Key and signing method. Consult the service documentation for details.
但是事实并非如此,因为所有旧键都可以使用相同的键正常工作。
因此,如果其他人可以用他们的帐户测试示例代码来检查是否存在相同的问题,我将非常感激。 新环境是eu-central-1,ap-south-1和ap-southeast-2。 Endpoint Urls
示例代码:
var ses = require('node-ses');
var client = ses.createclient({ key: '',secret: '',amazon: 'https://email.eu-central-1.amazonaws.com'});
async function sendMessage() {
let options = {};
options.from = "test@aol.com";
options.to = "test2@aol.com";
options.subject = "TestMail";
options.message = "Test";
console.log("Try to sendMessage");
client.sendEmail(options,function (err,data,res) {
console.log("Error: " + JSON.stringify(err));
console.log("Data: " + data);
console.log("res: " + res);
});
}
sendMessage();
示例代码使用node-ses npm package,您只需要输入具有ses访问权限的aws iam用户凭据即可。
如果要检查其他区域,则必须在createclient
构造函数中更改url。
别担心,示例代码不会发送电子邮件!
如果该区域正常运行,则应引发类似于以下内容的错误消息:Email address is not verified. The following identities failed the check in region EU-WEST-1: test@aol.com,test2@aol.com"
否则,错误将是上述错误。 我还必须提到,我目前仍处于沙盒模式,所以也许沙箱用户无法访问新区域?