After reading through a ton of documentation posts and forum topics for Amazon SES about this issue, I finally found this post about the string list format that helped me be able to send an email with Amazon SES's sendmail API to multiple recipients.
Every way I tried getting this working, I was receiving errors like InvalidParameter for the sender, Unexpected list element termination for the error code, etc.
Normally, when sending email, you can either pass a single address or multiple addresses as a string, and you'll be fine:
- Single Address:
John Doe <johndoe></johndoe>
- Multiple Addresses:
John Doe <johndoe>, Jane Doe <janedoe></janedoe></johndoe>
...just add in a comma between each address, and you're golden. Amazon's SES API documentation says you can pass a 'string/array' for the 'ToAddresses' parameter, and those addresses will be sent an email. They're kinda lacking in implementation details, though, and it took some wrangling to find out that, using Amazon's PHP API class, I had to prepare my addresses like so:
For normal (single) email addresses, I could just go:
'ToAddresses' => 'John Doe
(The $destination parameter would be passed into $ses->send_mail).
However, for multiple email addresses, you must pass in an array, with the following structure, and pass that to the CFComplexType object:
'member' => array(
0 => 'John Doe
1 => 'Jane Doe
$destination = CFComplexType::map(array(
'ToAddresses' => $to,
I don't know why Amazon can't just accept a normal string with commas designating recipients, as that would make life easier, imo, but oh well.