pau*_*uel 1 php amazon-web-services amazon-ses
我想访问AWS SES Webservice以编程方式添加新验证的电子邮件身份.该API参考不给的相关信息,或者至少我无法找到它.
当我尝试访问api时,由于缺少签名而出现错误.
https://email.us-east-1.amazonaws.com?AWSAccessKeyId=EXAMPLEKeyId&Action=VerifyEmailIdentity&EmailAddress=someone@somewhere.org&Timestamp=2013-04-27T19:30:00Z&Version=2010-12-01&Signature=
Run Code Online (Sandbox Code Playgroud)
如何准确创建此签名,例如使用php的hash_hmac()?
我是否需要使用SES密钥来散列整个参数?
是否有比所记录的更新版本的SES API(2010-12-01)?
您应该再次阅读文档(再次).
看一下AWS PHP SDK,它可以帮到你很多.
示例实现类似于:
<?php
require 'aws.phar';
use Aws\Common\Enum\Region;
use Aws\Ses\SesClient;
try {
$ses = SesClient::factory(array(
'key' => 'YOUR_KEY',
'secret' => 'YOUR_SECRET',
'region' => Region::US_EAST_1
));
$ses->verifyEmailIdentity( array(
'EmailAddress' => 'the_mail_adress_to_verify@example.com'
));
}
catch( Exception $e )
{
echo $e->getMessage();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4771 次 |
| 最近记录: |