首页 > 解决方案 > AWS SES 使用密件抄送发送电子邮件

问题描述

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

收件人收到电子邮件,但密件抄送没有。我也尝试了我的个人电子邮件而不是 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'])

标签: pythonamazon-web-servicesemailaws-lambdaamazon-ses

解决方案


推荐阅读