Node.js(LoopBack 3) - 我可以通过 AWS SES 向多少收件人发送电子邮件?
Node.js(LoopBack 3) - How many recipients can I send emails to by AWS SES?
到目前为止,我一直在通过我的 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,我认为我可以使用 sendBulkTemplatedEmail()
功能无限制地发送 群发邮件 AWS JS SDK.
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()' 向每个收件人发送一封电子邮件。
感谢关注。
到目前为止,我一直在通过我的 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,我认为我可以使用 sendBulkTemplatedEmail()
功能无限制地发送 群发邮件 AWS JS SDK.
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()' 向每个收件人发送一封电子邮件。
感谢关注。