AWS SES 使用密件抄送发送电子邮件

时间:2021-04-26 22:32:03

标签: python amazon-web-services email aws-lambda amazon-ses

我的密件抄送地址收不到电子邮件。我正在使用来自 Lambda 的 SES。

to 收到电子邮件,但 bcc 没有。我也尝试过使用我的个人电子邮件而不是 trustpilot 进行测试。

功能如下:

def send_email(to_email, from_email, first_name):
    name_displayed = '"Hello World " <' + from_email + '>'
    
    trustpilot_email = 'xxxxxxxx@invite.trustpilot.com'

    response = ses_client.send_email(
        Source=name_displayed,
        Destination={
            'ToAddresses': [
                to_email,
            ],
            'BccAddresses': [
                trustpilot_email,
            ]
        },
        Message={
            'Subject': {
                'Data': 'Hi ' + first_name + 'Welcome to the World!',
                'Charset': 'utf8'
            },
            'Body': {
                'Text': {
                    'Data': 'Hi ' + first_name + ' - Welcome to the World!',
                    'Charset': 'utf8'
                },
                'Html': {
                    'Data': 'Hi ' + first_name + ' - Welcome to the World!',
                }
            }
        },
        ReplyToAddresses=[
            from_email
        ],
    )

    print('email sent', response['MessageId'])

0 个答案:

没有答案