Amazon SES returns the error mentioned above when i try to send an email that contains unicode characters in the To: field. Amazon SES Documentation says that such email addresses should be sent in MIME encoded-word syntax, which the mail gem (used by ActionMailer) is doing correctly, it is sent as: =?UTF-8?B?dmluYXl2aW5heeKAmXNAbWFpbGluYXRvci5jb20=?=
I was seeing this same error, and found it was due to an incorrect ReturnPath parameter. The error indicates your ReturnPath parameter does not have a domain name. The ReturnPath parameter should be an email address, and it's the address to which bounce notifications are forwarded.
The question is pretty old, but I'll add my case for it seems to be the first result searching for problems with "Missing finale @domain" on AWS SES.
(the only other SO question I found is AWS SES Missing final '@domain' PHP SDK )
As in the other question's answer, InvalidParameterValue is returned every time a parameter don't pass validation.
In my case I was using boto3 on python, composing the Destination parameter with some keys that could be empty, like so:
to = []
bcc = []
# Some code to populate one or both lists..
response = client.send_email(
Destination={
'ToAddresses': to,
'BccAddresses': bcc
},
Message={
'Body': {
'Html': {
'Charset': MAIL_CHARSET,
'Data': message,
},
'Text': {
'Charset': MAIL_CHARSET,
'Data': message,
},
},
'Subject': {
'Charset': MAIL_CHARSET,
'Data': subject,
},
},
Source=MAIL_SENDER,
)
If one of the two keys in the dict assigned to the Destination parameter was an empty list the InvalidParameterValue was returned. Solution is to simply remove empty, useless, key:
to = []
bcc = []
# Some code to populate one or both lists..
destinations = {
'ToAddresses': to,
'BccAddresses': bcc
}
response = client.send_email(
Destination={typ: addresses
for typ, addresses in destinations.iteritems()
if addresses},
Message={
'Body': {
'Html': {
'Charset': MAIL_CHARSET,
'Data': message,
},
'Text': {
'Charset': MAIL_CHARSET,
'Data': message,
},
},
'Subject': {
'Charset': MAIL_CHARSET,
'Data': subject,
},
},
Source=MAIL_SENDER,
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With