【发布时间】:2015-08-11 14:29:30
【问题描述】:
我正在使用 nodejs nodemailer 连接到 Amazon SES 电子邮件服务。这一切看起来都很简单,但我不断收到错误:
“我们计算的请求签名与您提供的签名不匹配。请检查您的 AWS Secret Access Key 和签名方法。有关详细信息,请参阅服务文档。”
我已经在网上搜索过,大多数人说这是因为您的密钥末尾有一个空格,或者有时正斜杠可能会导致问题。最后一个不再是问题,因为我一直在创建 SMTP 凭证,直到没有凭证为止。我现在已经创建了大约 10 个 SMTP 凭据,每次都复制并粘贴了 AccessKey 和 SecretKey,但我仍然收到此错误。我也尝试过使用http://email-smtp.us-west-2.amazonaws.com,但仍然遇到同样的错误。
这是我的代码:
var nodemailer = require("nodemailer");
var transport = nodemailer.createTransport("SES",
{
AWSAccessKeyID: 'AKIA************',
AWSSecretKey: 'AqlwF*****************************',
SeviceUrl: 'http://email-smtp.us-east-1.amazonaws.com'
});
nodemailer.sendMail({
transport : transport,
sender : 'some@thing.com' ,
to : 'another@address.com',
subject : 'TEST',
html: '<p> Hello World </p>'
}, function(error, response)
{
if(error){ console.log(error); }
else{ console.log("Message sent: " + response.message);}
});
有人知道我还能做什么吗?
【问题讨论】:
-
这个运气好吗?我刚刚在开发者的 github 上创建了一个问题。
标签: amazon-ses nodemailer