Amazon SES - SMTP错误状态码403:SignatureDoesNotMatch



我创建了amazon trail帐户来测试SES SMTP服务,但是我得到了以下错误

{ [SignatureDoesNotMatch: 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.

The Canonical String for this request should have been
'POST
/
host:email.us-west-2.amazonaws.com
x-amz-content-sha256:72ac6f1d5dc1a4218fc4076dea3277a8a676b15e2c5143229cb3503465817440
x-amz-date:20160912T084424Z
host;x-amz-content-sha256;x-amz-date
72ac6f1d5dc1a4218fc4076dea3277a8a676b15e2c5143229cb3503465817440'
The String-to-Sign should have been
AWS4-HMAC-SHA256
20160912T084424Z
20160912/us-west-2/ses/aws4_request
a1b9fe2e23bbd4456f9b2a8f4115bd84571b8ccbbf9612d2e6b9d330ca6975a7'
]
  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.nnThe Canonical String for this request should have beenn'POSTn/nnhost:email.us-west-2.amazonaws.comnx
-amz-content-sha256:72ac6f1d5dc1a4218fc4076dea3277a8a676b15e2c5143229cb3503465817440nx-amz-date:20160912T084424Znnhost;x-amz-content-sha256;x-amz-d
aten72ac6f1d5dc1a4218fc4076dea3277a8a676b15e2c5143229cb3503465817440'nnThe String-to-Sign should have beenn'AWS4-HMAC-SHA256n20160912T084424Zn
20160912/us-west-2/ses/aws4_requestna1b9fe2e23bbd4456f9b2a8f4115bd84571b8ccbbf9612d2e6b9d330ca6975a7'n',
  code: 'SignatureDoesNotMatch',
  time: Mon Sep 12 2016 14:14:27 GMT+0530 (India Standard Time),
  requestId: '1cc26156-78c5-11e6-8397-a55641b47b84',
  statusCode: 403,
  retryable: false,
  retryDelay: 55.79463441390544 }

这是NodeJS脚本,我正在使用

var aws = require('aws-sdk');
var ses = new aws.SES({
    'accessKeyId': 'KEY',
    'secretAccessKey': 'SECRET',
    'region': 'REGION'
});
var eparam = {
    Destination: {
        ToAddresses: ['mirXXXX@gmail.com']
    },
    Message: {
        Body: {
            Html: {
                Data: '<p>Hello, this is a test email!</p>'
            },
            Text: {
                Data: 'Hello, this is a test email!'
            }
        },
        Subject: {
            Data: 'SES email test'
        }
    },
    Source: 'mirXXXX@outlook.com',
    ReplyToAddresses: ['mirXXXX@outlook.com'],
    ReturnPath: 'mirXXXX@outlook.com'
};
ses.sendEmail(eparam, function (err, data) {
    if (err) console.log(err);
    else console.log(data);
});

请注意:

电子邮件地址mirXXXX@outlook.com和mirXXXX@gamil.com两者都经过验证。我的SES区域是us-west-2

我一直有同样的问题,我最终使用SMTP设置,类似于本教程,并从2.6降级到> 0.7.1来发送我的邮件。有一些配置问题,没有足够的文档记录,在特定的谷歌搜索两天后发现。

相关内容

  • 没有找到相关文章

最新更新