Skip to content

Instantly share code, notes, and snippets.

@nagataka
Created February 12, 2015 01:53
Show Gist options
  • Select an option

  • Save nagataka/76016715ee26e1161755 to your computer and use it in GitHub Desktop.

Select an option

Save nagataka/76016715ee26e1161755 to your computer and use it in GitHub Desktop.
send message by AWS SES using AWS SDK for PHP 2
#!/usr/bin/php
<?php
require 'AWS_SDK_PHP2/aws-autoloader.php';
use Aws\Ses\SesClient;
$client = SesClient::factory(array(
'key' => "XXXXXXXXXXXXXXXXXXXX",
'secret' => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
'region' => "us-east-1"
)
);
$result = $client->sendEmail(array(
'Source' => 'from_addr@example.co.jp',
'Destination' => array(
'ToAddresses' => array('to_adde@test.com')
),
'Message' => array(
'Subject' => array(
'Data' => 'this is SES test'
),
'Body' => array(
'Text' => array(
'Data' => 'this is test.'
),
),
)
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment