我正在尝试通过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': [
'xxx@xxx.com',
],
},
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='xxx@xxx.com',
SourceArn='',
)
我该怎么修复这个问题?
é
或ñ
)? - Michael - sqlbot