Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
486 views
in Technique[技术] by (71.8m points)

amazon web services - AWS SES failing with "Recipient count exceeds 50." on individual recipient emails

We are looping on 160 email addresses in AWS Lambda and calling SES' send_raw_email() API call with one address per call. After 50 loops we get the error "Recipient count exceeds 50." but there is only one recipient per call. The other information in the emails, other than "To:", are the same between calls. We do this to keep recipients from seeing the addresses of other recipients.

Are the emails being batched at SES? (How are we even hitting this limit?)

How can we get past this error?

Adding code:

for item in recipients['Items']:
    RECIPIENT = item['email']['S']
    
    msg['To'] = RECIPIENT

    try:
        #Provide the contents of the email.
        response = ses.send_raw_email(
            Source=SENDER,
            Destinations=[
                RECIPIENT
            ],
            RawMessage={
                'Data':msg.as_string(),
            }
        )
    # Display an error if something goes wrong. 
    except ClientError as e:
        print("failed to send email: ",e.response['Error']['Message'])
        return {
        'statusCode': 400,
        'body': json.dumps(e.response['Error']['Message'])
    }
    else:
        print("Email sent! Message ID:"),
        print(response['MessageId'])
question from:https://stackoverflow.com/questions/65839036/aws-ses-failing-with-recipient-count-exceeds-50-on-individual-recipient-email

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...