简体   繁体   English

Node.js(LoopBack 3) - 我可以通过 AWS SES 向多少个收件人发送电子邮件?

[英]Node.js(LoopBack 3) - How many recipients can I send emails to by AWS SES?

As so far, I've been sending emails to multiple recipients by Sakura Japan SMTP server in my LoopBack app.到目前为止,我一直在我的LoopBack应用程序中通过Sakura Japan SMTP 服务器向多个收件人发送电子邮件。

{
  "emailDs": {
    "name": "emailDs",
    "connector": "mail",
    "transports": [{
      "type": "smtp",
      "host": "myapp.sakura.ne.jp",
      "secure": false,
      "port": 587,
      "tls": {
        "rejectUnauthorized": false
      },
      "auth": {
        "user": "~ ~ ~.sakura.ne.jp",
        "pass": "~ ~ ~"
      }
    }]
  }
}

It's almost working properly unless the number of recipients is much less than 100 .除非收件人数量远小于100 ,否则它几乎可以正常工作。 But it won't work when the number quite over 100 - eg 150 .但是当数字超过100时它不起作用- 例如150


Thus , I'm going to migrate AWS SES but I wonder if there would be any restriction with the number of recipients just due to the following quotation :因此,我将迁移AWS SES但我想知道是否会因为以下引用而对收件人数量有任何限制

The message cannot include more than 50 recipients, across the To:, CC: and BCC: fields.邮件包含的收件人不能超过 50 个,跨越收件人:、抄送:和密件抄送:字段。 If you need to send an email message to a larger audience, you can divide your recipient list into groups of 50 or fewer, and then call the sendEmail method several times to send the message to each group.如果您需要向更多的受众发送电子邮件,您可以将您的收件人列表分成 50 个或更少的组,然后多次调用 sendEmail 方法将邮件发送到每个组。

So, please anybody tells me whether there's a limit with the number of recipients or not if you've experienced in.所以,请任何人告诉我,如果您经历过,收件人数量是否有限制。

Thanks in advance.提前致谢。

PS: Here the sample code of AWS SES goes: PS: AWS SES的示例代码如下:

// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
// Set the region 
AWS.config.update({region: 'REGION'});

// Create sendBulkTemplatedEmail params 
var params = {
  Destinations: [ /* required */
    {
      Destination: { /* required */
        CcAddresses: [
          'EMAIL_ADDRESS',
          /* more items */
        ],
        ToAddresses: [
          'EMAIL_ADDRESS',
          'EMAIL_ADDRESS'
          /* more items */
        ]
      },
      ReplacementTemplateData: '{ \"REPLACEMENT_TAG_NAME\":\"REPLACEMENT_VALUE\" }'
  },
  ],
  Source: 'EMAIL_ADDRESS', /* required */
  Template: 'TEMPLATE_NAME', /* required */
  DefaultTemplateData: '{ \"REPLACEMENT_TAG_NAME\":\"REPLACEMENT_VALUE\" }',
  ReplyToAddresses: [
    'EMAIL_ADDRESS'
  ]
};


// Create the promise and SES service object
var sendPromise = new AWS.SES({apiVersion: '2010-12-01'}).sendBulkTemplatedEmail(params).promise();

// Handle promise's fulfilled/rejected states
sendPromise.then(
  function(data) {
    console.log(data);
  }).catch(
    function(err) {
    console.log(err, err.stack);
  });

According to the AWS SES documentation , I've thought that I could send bulk mails without any limitation by using sendBulkTemplatedEmail() function of AWS JS SDK .根据AWS SES 文档,我认为我可以通过使用 AWS JS SDK 的sendBulkTemplatedEmail()函数而不受任何限制地发送批量邮件

Create an object to pass the parameter values that define the email to be sent, including sender and receiver addresses, subject, email body in plain text and HTML formats, to the sendBulkTemplatedEmail method of the AWS.SES client class.创建一个对象以将定义要发送的电子邮件的参数值(包括发件人和收件人地址、主题、纯文本和 HTML 格式的电子邮件正文)传递给 AWS.SES 客户端类的 sendBulkTemplatedEmail 方法。 To call the sendBulkTemplatedEmail method, create a promise for invoking an Amazon SES service object, passing the parameters.要调用 sendBulkTemplatedEmail 方法,请创建一个用于调用 Amazon SES 服务对象并传递参数的承诺。 Then handle the response in the promise callback.然后在承诺回调中处理响应。


However, the following 2 links explain me the different workaround for the production lifecycle since there's an even technical restriction of 50 recipients .但是,以下 2 个链接向我解释了生产生命周期的不同解决方法,因为有50 个收件人均匀技术限制

AWS SES SendBulkTemplatedEmail, example and what happens if quota is exceeded? AWS SES SendBulkTemplatedEmail,示例以及超出配额会发生什么情况?

Managing Your Amazon SES Sending Limits 管理您的 Amazon SES 发送限制

So, AWS SES recommends that I'd call sendEmail() once for every recipient.因此, AWS SES建议我为每个收件人调用一次sendEmail()

Sending limits are based on recipients rather than on messages.发送限制基于收件人而不是消息。 For example, an email that has 10 recipients counts as 10 against your quota.例如,有 10 个收件人的电子邮件在您的配额中计为 10 个。 However, we do not recommend that you send an email to multiple recipients in one call to SendEmail because if the call to Amazon SES fails (for example, the request is improperly formatted), the entire email will be rejected and none of the recipients will get the intended email.但是,我们不建议您在一次 SendEmail 调用中向多个收件人发送一封电子邮件,因为如果对 Amazon SES 的调用失败(例如,请求格式不正确),整个电子邮件将被拒绝,并且任何收件人都不会获取预期的电子邮件。 We recommend that you call SendEmail once for every recipient.我们建议您为每个收件人调用一次 SendEmail。


To make a long story short ,长话短说

  • There's no theoretical restriction of recipient number when we send mails to multiple addresses.当我们将邮件发送到多个地址时,收件人号码没有理论上的限制。
  • But there's a technical restriction of 50 recipients when we send bulk mails by calling sendBulkTemplatedEmail()但是当我们通过调用sendBulkTemplatedEmail()发送批量邮件时,有 50 个收件人的技术限制
  • The best solution is to send an email to every recipient by calling 'sendEmail()' multiple times.最好的解决方案是通过多次调用“sendEmail()”向每个收件人发送一封电子邮件。

Thanks for attention.谢谢关注。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM