我正在尝试通过AWS SES发送电子邮件,但收到此错误:

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the SendEmail operation: Illegal address

我已经验证了要发送和发送的电子邮件。
这是我的代码:
import boto3

client = boto3.client(
    'ses',
    aws_access_key_id=AWS_ACCESS_KEY,
    aws_secret_access_key=AWS_SECRET_KEY
)


response = client.send_email(
    Destination={
        'ToAddresses': [
            '[email protected]',
        ],
    },
    Message={
        'Body': {
            'Html': {
                'Charset': 'UTF-8',
                'Data': 'This message body contains HTML formatting. It can, for example, contain links like this one: <a class="ulink" href="http://docs.aws.amazon.com/ses/latest/DeveloperGuide" target="_blank">Amazon SES Developer Guide</a>.',
            },
            'Text': {
                'Charset': 'UTF-8',
                'Data': 'This is the message body in text format.',
            },
        },
        'Subject': {
            'Charset': 'UTF-8',
            'Data': 'Test email',
        },
    },
    ReplyToAddresses=[
    ],
    ReturnPath='',
    ReturnPathArn='',
    Source='[email protected]',
    SourceArn='',
)

我怎样才能解决这个问题?

最佳答案

尝试删除以下内容:

    ReplyToAddresses=[],
    ReturnPath='',
    ReturnPathArn='',
    SourceArn='',

显然他们不能为空!

关于python - 亚马逊SES : SendEmail operation: Illegal addres错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43157065/

10-12 05:04