我正试图从PHP向我的Amazon SES帐户添加一个域进行验证。我尝试使用以下代码:
$result = $amazonSesClient->verifyDomainDkim([
'Domain' => 'mydomain.com', // REQUIRED
]);
但它导致了这一点(注意,目前SES账户上没有可用的验证域):
PHP Fatal error: Uncaught exception 'AwsSesExceptionSesException' with message 'Error executing "PutIdentityPolicy" on "https://email.us-west-2.amazonaws.com"; AWS HTTP error: Client error: `POST https://email.us-west-2.amazonaws.com` resulted in a `400 Bad Request` response:
<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<Error>
<Type>Sender</Type>
<Code>InvalidPoli (truncated...)
InvalidPolicy (client): Unable to parse policy. - <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<Error>
<Type>Sender</Type>
<Code>InvalidPolicy</Code>
<Message>Unable to parse policy.</Message>
</Error>
<RequestId>a900a249-f032-11e5-85bd-77394342cf29</RequestId>
</ErrorResponse>
'
exception 'GuzzleHttpExceptionClientException' with message 'Client error: `POST https://email.us-west-2.amazonaws.com` resulted in a `400 Bad Request` response:
<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<Error>
<Type>Sender</Type>
<Code>InvalidPoli (truncated...)
' in in /var/www/html/bin/aws/Aws/WrappedHttpHandler.php on line 159
如果我手动添加域,它会按预期返回DKIM,但我如何以编程方式添加它?文档听起来像是该方法应该添加域进行验证,然后返回其DKIM记录?
使用相同参数的verifyDomainIdentity(),然后发出第二个请求以获取DKIM数据。