Solution: Encode your data in base64. Had to check their sample Perl script just to discover this. :-/
Working example:
<?phprequire 'AWSSDKforPHP/aws.phar'; use Aws\Ses\SesClient; $client = SesClient::factory(Array(
'key => 'foobar',
'secret' => 'foobarsecret', 'region' => 'us-east-1' )); $data =<<EOD
From: "Example" <user@example.org> To: "Simon Cornelius P. Umacob" <simoncpu@simoncpu.example.org> hello world! EOD; $tmp = $client->sendRawEmail(Array( 'Source' => 'user@example.org', 'Destinations' => Array('simoncpu@simoncpu.example.org'), 'RawMessage' => Array( 'Data' => base64_encode($data) ) )); var_dump($tmp); ?>
No comments:
Post a Comment