Amazon SES error: Missing required header 'To'

amazon-ses, email, php, send

Solution

I already solved it, I had two problems in my code:

- The index "ToAddress" is incorrect, it has to be in plural "ToAddresses".

- And the value it has to be an array like this: array('mario@wowfi.com')

Problem

I'm new in Amazon SES and I'm trying to send an email with this code: ``` <?php require_once 'aws/sdk.class.php'; $ses = new AmazonSES(); $to = array('ToAddress' => 'mario@wowfi.com'); $content = array('Subject.Data' => 'Tema', 'Body.Text.Data' => 'hello'); $r = $ses->send_email("mario@wowfi.com", $to , $content); print_r($r); ?> ``` In the output it says: Missing required header 'To', what am I doing wrong?

Original source