gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 23:56:53 31 4
gpt4 key购买 nike

到目前为止,我一直在我的 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. But it won't work when the number quite over 100 - e.g. 150.

<小时/>

因此,我将迁移 AWS SES,但我想知道仅由于 following quotation 的原因,收件人数量是否会有任何限制 :

The message cannot include more than 50 recipients, across the To:, CC: and BCC: fields. 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.

所以,如果您有过这样的经历,请告诉我收件人数量是否有限制。

提前致谢。

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);
});

最佳答案

根据AWS SES documentation ,我认为我可以使用 AWS JS SDKsendBulkTemplatedEmail() 函数发送没有任何限制的批量邮件

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. To call the sendBulkTemplatedEmail method, create a promise for invoking an Amazon SES service object, passing the parameters. Then handle the response in the promise callback.

<小时/>

但是,以下 2 个链接向我解释了生产生命周期的不同解决方法,因为甚至有 50 个收件人的技术限制

AWS SES SendBulkTemplatedEmail, example and what happens if quota is exceeded?

Managing Your Amazon SES Sending Limits

因此,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. 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. We recommend that you call SendEmail once for every recipient.

<小时/>

长话短说

  • 理论上,当我们向多个地址发送邮件时,收件人数量没有限制。
  • 但是,当我们通过调用 sendBulkTemplatedEmail() 发送批量邮件时,存在 50 个收件人的技术限制
  • 最佳解决方案是通过多次调用“sendEmail()”向每个收件人发送电子邮件。

感谢您的关注。

关于Node.js(LoopBack 3) - 我可以通过 AWS SES 向多少个收件人发送电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56707133/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com