Using AWS SES API


Using AWS SES API

我想访问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=

如何创建这个签名,例如使用php的hash_hmac()?

我需要使用SES密钥散列整个参数吗?

是否有比文档(2010-12-01)更新的SES API版本?

您应该(再)浏览一下文档。

看看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();
}