In my case, I wanted to tướng tin nhắn to tướng the same verify tin nhắn address. So, I verified my tin nhắn by DKIM as @Greg Wozniak mentioned. I saw the field tick green and verified:
But I was still seeing:
Email address is not verified. The following identities failed the kiểm tra in region...
The solution in my case was to tướng add this function in the code:
def verify_email_identity():
ses_client = boto3.client("ses", region_name="us-east-1")
response = ses_client.verify_email_identity(
# Thư điện tử address that will receive the tin nhắn
# In my case the same tin nhắn address
# that was verified on Amazon SES
EmailAddress="[email protected]"
)
print(response)
Taken from this website
So, I received a new tin nhắn to tướng verify the recipient tin nhắn address. After verify the recipient tin nhắn address by clicking on the liên kết sent by Amazon SES. I was able to tướng send the tin nhắn with this code:
client = boto3.client('ses',region_name="us-east-1")
# Try to tướng send the tin nhắn.
try:
#Provide the contents of the tin nhắn.
response = client.send_email(
Destination={
'ToAddresses': [
[email protected],
],
},
Message={
'Body': {
'Html': {
'Charset': "UTF-8",
'Data': "Test",
},
},
'Subject': {
'Charset': "UTF-8",
'Data': "Test",
},
},
[email protected],
)
# Display an error if something goes wrong.
except ClientError as e:
print(e.response['Error']['Message'])
else:
print("Email sent! Message ID:"),
print(response['MessageId'])