use Aws\Ses\Exception\SesException;
use Aws\Ses\SesClient;
$ses = new SesClient([
'profile' => 'default',
'region' => 'us-west-2', //任意のもの
'version' => '2010-12-01'
])
//送信対象のメールのリスト
$mailList = ['aaa@aaa.com', 'bbb@bbb.com'];
//HTMlメールのボディ
$html = '<h1>AWS Amazon Simple Email Service Test Email</h1>'.
'<p>This email was sent with <a href="https://aws.amazon.com/ses/">'.
'Amazon SES</a> using the <a href="https://aws.amazon.com/sdk-for-php/">'.
'AWS SDK for PHP</a>.</p>';
//件名
$subject = 'test'
try {
$result = $ses->sendEmail([
'Destination' => [
'ToAddresses' => [$mailList],
],
'Source' => 'ccc@ccc.com',
'Message' => [
'Body' => [
'Html' => [
'Charset' => 'utf-8',
'Data' => $html,
],
],
'Subject' => [
'Charset' => 'utf-8',
'Data' => $subject,
],
],
]);
echo $result['MessageId'];
} catch (SesException $e) {
echo $e->getMessage();
}