2018-10-11 15:00:23 -07:00
< ? php
2018-12-28 10:35:52 -08:00
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2018-10-11 15:00:23 -07:00
// SPDX-License-Identifier: Apache-2.0
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
/*
2018-10-16 20:34:57 -07:00
* ABOUT THIS PHP SAMPLE => This sample is part of the SDK for PHP Developer Guide topic at
* https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-verify.html
2018-10-11 15:00:23 -07:00
*
*/
2019-02-05 21:31:08 -08:00
// snippet-start:[ses.php.add_email.complete]
// snippet-start:[ses.php.add_email.import]
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
require 'vendor/autoload.php' ;
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
use Aws\Exception\AwsException ;
2024-02-05 10:49:20 -07:00
2019-02-05 21:31:08 -08:00
// snippet-end:[ses.php.add_email.import]
2024-02-05 10:49:20 -07:00
2019-02-05 21:31:08 -08:00
//Create a SESClient
// snippet-start:[ses.php.add_email.main]
2019-06-07 20:04:21 +09:00
$SesClient = new Aws\Ses\SesClient ([
2018-10-11 15:00:23 -07:00
'profile' => 'default' ,
'version' => '2010-12-01' ,
'region' => 'us-east-2'
]);
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
$email = 'email_address' ;
2024-02-05 10:49:20 -07:00
2018-10-11 15:00:23 -07:00
try {
$result = $SesClient -> verifyEmailIdentity ([
'EmailAddress' => $email ,
]);
var_dump ( $result );
} catch ( AwsException $e ) {
// output error message if fails
echo $e -> getMessage ();
echo " \n " ;
}
2024-02-05 10:49:20 -07:00
2019-02-05 21:31:08 -08:00
// snippet-end:[ses.php.add_email.main]
// snippet-end:[ses.php.add_email.complete]