带有节点-ses的AWS错误403

时间:2018-07-15 16:48:40

标签: reactjs amazon-web-services amazon-ses

我正在尝试在一个小型reactjs应用程序中收集文本区域的内容,并将其发送到一个单独的硬编码电子邮件地址。我正在使用node-ses这样做,因为这似乎是一个简单的解决方案,但我不断收到此错误:

 "Type": "Sender",
 "Code": "SignatureDoesNotMatch",
 "Message": "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."

从我发现的所有相关问题中,答案似乎都涉及使用一组不同的凭据。我尝试了SES SMTP凭据,新的IAM用户访问密钥ID和秘密密钥,以及根访问密钥ID和秘密密钥,并且存在完全相同的错误。

我想知道我在createClient方法中是否做错了什么,但是没有太多的余地……这是相关的节点代码,使用了新创建的IAM用户密钥和经过验证的电子邮件to和from值的地址。

const client = ses.createClient({
  key: "xxxxxxxxxxxxxxxxxxx",
  secret: "xxxxxxxxxxxxxxxxxxx",
  amazon: "https://email.us-west-2.amazonaws.com"
});

  sendIt() {
    client.sendEmail({
    to: 'xxxxxx@gmail.com',
    from: 'xxxxxx@gmail.com',
    subject: 'RIP Sara',
    message: this.state.message,
  }, function (err, data, res) {
    console.log(JSON.stringify(err, "", " "));
  })
}

任何建议都非常感谢。干杯。

0 个答案:

没有答案