PHP调用AWS SES服务发送邮件报403 Forbidden SignatureDoesNotMatch
错误描述
使用sdk-for-php
:https://docs.aws.amazon.com/zh_cn/sdk-for-php/v3/developer-guide/welcome.html
$emailConfig = [
'key' => 'xxxxxx',
'secret' => 'xxxxxx',
'region' => 'us-east-1',
'sender' => 'support@appblog.cn',
];
Error executing "SendRawEmail" on "https://email.us-east-1.amazonaws.com"; AWS HTTP error: Client error: `POST https://email.us-east-1.amazonaws.com` resulted in a `403 Forbidden` response:
<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<Error>
<Type>Sender</Type>
<Code>SignatureDo (truncated...)
SignatureDoesNotMatch (client): The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/
host:email.us-east-1.amazonaws.com
x-amz-date:20210330T020743Z
host;x-amz-date
e921dae6c46aa9c5db01b8aa68fefc10794c65c6612987d85d1c3482943b2eba'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210330T020743Z
20210330/us-east-1/ses/aws4_request
968b7b0686f381beefac6be2b39637cd5ed83071624c4a47f3d6a6bad89b5c1c'
- <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<Error>
<Type>Sender</Type>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/
host:email.us-east-1.amazonaws.com
x-amz-date:20210330T020743Z
host;x-amz-date
e921dae6c46aa9c5db01b8aa68fefc10794c65c6612987d85d1c3482943b2eba'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210330T020743Z
20210330/us-east-1/ses/aws4_request
968b7b0686f381beefac6be2b39637cd5ed83071624c4a47f3d6a6bad89b5c1c'
</Message>
</Error>
<RequestId>f020662d-0b8d-432b-93af-0b649a0c2a21</RequestId>
</ErrorResponse>
解决方法
版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/28/php-calls-aws-ses-service-to-send-email-message-403-forbidden-signaturedoesnotmatch/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。
THE END
0
二维码
打赏
海报
PHP调用AWS SES服务发送邮件报403 Forbidden SignatureDoesNotMatch
错误描述
使用sdk-for-php:https://docs.aws.amazon.com/zh_cn/sdk-for-php/v3/developer-guide/welcome.html
$emailConfig = [
'key' ……
文章目录
关闭
共有 0 条评论