【问题标题】:AWS SES: Can't send emails from any one of the new regionsAWS SES:无法从任何一个新区域发送电子邮件
【发布时间】:2020-04-07 21:19:18
【问题描述】:

我的问题是我无法从新的 aws ses 环境发送电子邮件,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.

但事实并非如此,因为所有旧的都可以使用相同的键正常工作。

因此,如果 sb else 可以使用他们的帐户测试示例代码以检查他们是否有同样的问题,我将不胜感激。 新环境是 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"

否则错误将是上述错误。 还必须提一下,我目前仍处于沙盒模式,所以新区域可能已对沙盒用户屏蔽?

【问题讨论】:

    标签: amazon-web-services amazon-ses


    【解决方案1】:

    这是因为您必须从 IAM 控制台创建 SES 凭证。您应该改为使用 SES 界面/控制台创建凭据。

    按照本文使用 SES 接口创建 smtp 凭据: http://docs.amazonwebservices.com/ses/latest/GettingStartedGuide/GetAccessIDs.html.

    【讨论】:

    • 我之前已经尝试过了,smtp 凭证根本不起作用。这不是问题,因为凭据有效,我可以从任何一个旧的 ses 环境发送电子邮件,例如我们-东-1。只是最近添加的新功能不起作用。
    • > 您用于通过 Amazon SES SMTP 接口发送电子邮件的凭证对于每个 AWS 区域都是唯一的。 docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html
    • 是的,我现在。但我不使用 smtp 接口,我使用 ses api。因此,我使用 iam 用户,它应该可以跨区域工作(并且在 us-west-1、us-east-1 和 eu-west-1 中工作)。只是新环境不起作用。
    • 好的,您是否从 IAM 用户凭证中获取了 SMTP 凭证。您必须使用本节提供的算法从用户的 AWS 凭证派生出用户的 SMTP 凭证。 docs.aws.amazon.com/ses/latest/DeveloperGuide/…
    • 您还面临这个问题吗?我很想知道你是如何修复它的
    猜你喜欢
    • 1970-01-01
    • 2020-11-25
    • 1970-01-01
    • 1970-01-01
    • 2016-11-17
    • 2022-05-23
    • 2018-09-09
    • 2014-06-28
    • 2020-03-25
    相关资源
    最近更新 更多