4

Here's a tidbit so you don't have to spend two hours nearly tearing out your hair like I just did.

I was receiving the following error message: Fatal error: Uncaught Aws\Ses\Exception\SesException: AWS Error Code: InvalidParameterValue, Status Code: 400, AWS Request ID: [Removed for stackoverflow], AWS Error Type: client, AWS Error Message: Missing final '@domain', User-Agent: aws-sdk-php2/2.6.6 Guzzle/3.9.1 curl/7.36.0 PHP/5.5.12

Earlier errors had shown validation taking place, (e.g. ToAddresses must be an array), so I assumed the data was validated. To a degree, I was wrong.

Gerald Schneider
  • 17,416
  • 9
  • 60
  • 78
Mark Kasson
  • 1,600
  • 1
  • 15
  • 28
  • Make sure you check *all* email parameters that get included in the SES/SMTP call - in my case all From, To, CC etc were correct but I had a Reply-To (inserted by some custom logic) which wasn't a valid email - literally "missing final @domain" – Janaka Bandara Nov 04 '21 at 04:26

1 Answers1

4

Despite the name, this is an error indicating that SES doesn't like one of your parameters. In my case, I had used the code on this page from the PHP SDK documentation to build up the parameter for sendEmail() and I had left Source as 'string'.

Try building your parameter for sendEmail() as $msg and using echo "sendSES msg: ".print_r($msg, true); to see exactly what's going to SES.

Postfix users may have the issue that the email address is not matching the ec2 domain name. It is a different issue, but similar in that it is SES rejecting the semantics of the data.

Mark Kasson
  • 1,600
  • 1
  • 15
  • 28
  • So, you had left Source as 'string' and it was the issue. And what was you change that fixed the issue? – Viktar Pryshchepa Jul 09 '20 at 08:06
  • Per the Parameter Details for sendEmail, Source should be "The email address that is sending the email. This email address must be either individually verified with Amazon SES, or from a domain that has been verified with Amazon SES." I changed it to my email address that I am sending from. – Mark Kasson Jul 09 '20 at 14:31