简体   繁体   English

我可以使用我的域名下的任何 email 使用 AWS SES 发送电子邮件吗?

[英]Can I use any email under my domain name to send emails using AWS SES?

Pardon me if I am asking a pretty dumb question.如果我问了一个非常愚蠢的问题,请原谅我。 I am new to SES and I could not find a straight answer in the AWS docs about this.我是 SES 的新手,在 AWS 文档中找不到关于此问题的直接答案。

Some background info: I am using node server on EC2.一些背景信息:我在 EC2 上使用节点服务器。 I own a domain, let's say "mydomain.com".我拥有一个域,比如说“mydomain.com”。 I only need AWS SES to send out emails to my customers and I plan to use AWS-SDK in my EC2 server to talk to SES.我只需要 AWS SES 向我的客户发送电子邮件,并且我计划在我的 EC2 服务器中使用 AWS-SDK 与 SES 对话。 I do not need to receive any emails from customers .我不需要收到任何来自客户的电子邮件

According to AWS SES docs, I only need to verify either my domain OR my email address - just one of them.根据 AWS SES 文档,我只需要验证我的域或 email 地址 - 只是其中之一。

Let's say I choose to verify my domain, mydomain.com, and I did not verify email.假设我选择验证我的域 mydomain.com,但我没有验证 email。 So, when I use AWS-SDK sendEmail(), what email should/can I use given that I did not verify any email?那么,当我使用 AWS-SDK sendEmail() 时,鉴于我没有验证任何 email,我应该/可以使用什么 email?

Can I use any email as long as it is using my domain name?只要使用我的域名,我可以使用任何 email 吗? Eg support@mydomain.com?例如 support@mydomain.com?

Thank you for your answer!谢谢您的回答!

The verification is there to make sure you are the owner of the domain or at least an email address you want to use.验证是为了确保您是所有者,或者至少是您想要使用的 email 地址

So when you verify the domain you are verified as the admin of the domain and thus have access to any of the email address on that specific domain.因此,当您验证域时,您将被验证为域的管理员,因此可以访问该特定域上的任何 email 地址。

To elaborate, if you can prove that you can change the DNS records of the domain (as you did for the verification) you can change any email related DNS records such as the MX records (more on the wiki) and thus any additional verification is not necessary.详细地说,如果您可以证明您可以更改域的 DNS 记录(就像您为验证所做的那样),您可以更改任何与 email 相关的 DNS 记录,例如MX 记录,因此任何其他验证记录都在 wiki上不必要。

I encourage you to learn more about the MX records.我鼓励您了解有关 MX 记录的更多信息。

As long as you are able to verify your domain, yes you can use any email with your domain name.只要您能够验证您的域,是的,您可以将任何 email 与您的域名一起使用。 AWS wants to know you are the owner of the domain. AWS 想知道您是域的所有者。

Tip regarding:关于提示:

"I plan to use AWS-SDK in my EC2 server to talk to SES." “我计划在我的 EC2 服务器中使用 AWS-SDK 与 SES 对话。”

I would recommend to use AWS Lambda function using NodeJS and trigger them from the API gateway.我建议使用 NodeJS 使用 AWS Lambda function 并从 API 网关触发它们。 This way you will save money spent on monthly EC2 instances with highly available API to send out emails.通过这种方式,您将节省每月使用高可用 API 发送电子邮件的 EC2 实例的费用。

Additionally you can then use this API anywhere in your business process flows.此外,您可以在业务流程中的任何位置使用此 API。

Here is a sample code to send out emails using AWS SES service via Lambda function.这是使用 AWS SES 服务通过 Lambda function 发送电子邮件的示例代码。

var AWS = require('aws-sdk');
var ses = new AWS.SES();
 
var RECEIVER = 'to@yourdomain.com';
var SENDER = 'from@yourdomain.com';

var response = {
 "isBase64Encoded": false,
 "statusCode": 200,
 "headers": {
        "X-Requested-With": '*',
        "Access-Control-Allow-Headers": 'Content-Type,X-Amz-Date,Authorization,X-Api-Key,x-requested-with',
        "Access-Control-Allow-Origin": '*',
        "Access-Control-Allow-Methods": 'POST,GET,OPTIONS'
    },
 "body": "{\"result\": \"Success.\"}"
 };

exports.handler = function (event, context) {
    var formdata = JSON.parse(event.body);
    sendEmail(formdata, function (err, data) {
        context.done(err, response);
    });
};
 
function sendEmail (formdata, done) {
    var params = {
        Destination: {
            ToAddresses: [
                RECEIVER
            ]
        },
        Message: {
            Body: {
                Text: {
                    Data: 'name: ' + formdata.name + '\nemail: ' + formdata.email + '\ndesc: ' + formdata.desc,
                    Charset: 'UTF-8'
                }
            },
            Subject: {
                Data: 'Website Referral Form: ' + formdata.name,
                Charset: 'UTF-8'
            }
        },
        Source: SENDER
    };
    ses.sendEmail(params, done);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Nodemailer 使用我的公司域发送电子邮件? - How can I send email with my company domain using Nodemailer? Node.js(LoopBack 3) - 我可以通过 AWS SES 向多少个收件人发送电子邮件? - Node.js(LoopBack 3) - How many recipients can I send emails to by AWS SES? AWS SES发送电子邮件不起作用 - AWS SES send email not working 我可以使用 mailgun 的授权电子邮件向我的客户发送电子邮件吗? - Can I send emails to my customers using my mailgun's authorized email? 电子邮件已验证,但我仍然无法使用Amazon SES发送电子邮件 - E-mail is verified, but I still can't send emails using Amazon SES 使用 Node.js 中的 AWS SES 在 email 正文中发送超链接 - Send hyperlinks in email body using AWS SES in Node.js 如何使用 aws ses 在电子邮件标题中添加名称 - How to add name in email headers using aws ses 当我尝试在 localstack 中使用 aws ses 时未验证电子邮件地址 - Email address not verified when I try to use aws ses in localstack 尝试使用Alexa和AWS SES发送电子邮件。 电子邮件将发送,但是Alexa将返回并且错误 - Trying to Send Email Using Alexa and AWS SES. Email will send however Alexa will return and Error 无法使用 AWS SES 发送电子邮件:我没有正确配置它吗? - Can't send e-mail using AWS SES: didn't I configure it properly?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM