gpt4 book ai didi

php - 发件人签名不匹配签名已过期

转载 作者:行者123 更新时间:2023-12-05 07:48:31 25 4
gpt4 key购买 nike

嗨,我的代码几天前运行完美,我今天检查使用 amazon ses 服务发送电子邮件时出现错误

在“https://email.us-west-2.amazonaws.com”上执行“SendEmail”时出错; AWS HTTP 错误:客户端错误:POST https://email.us-west-2.amazonaws.com 导致 403 Forbidden 响应:Sender SignatureDo (truncated.. .) SignatureDoesNotMatch (client): Signature expired: 20160718T125547Z is now earlier than 20160718T125616Z (20160718T130116Z - 5 min.) - Sender SignatureDoesNotMatch Signature expired: 20160718T125547Z is now earlier than 20160718T125616Z (20160718T130116Z - 5 min.) b64acacc-4ce7-11e6-adb5- 0992ceb0921c

我的代码是:

require_once("aws/aws-autoloader.php");
use Aws\Ses\SesClient;

define('SENDER', 'no-reply@example.net');

define('RECIPIENT', 'my@example.com');
define('REGION','us-west-2');

$client = SesClient::factory(array(
'version'=> 'latest',
'region' => REGION,
'credentials' => array(
'key' => '******************',
'secret' => '*****************************',
)
));

$request = array();
$request['Source'] = SENDER;
$request['Destination']['ToAddresses'] = array(RECIPIENT);
$request['Message']['Subject']['Data'] = $subject;
$request['Message']['Body']['Text']['Data'] = $message;

try {
$result = $client->sendEmail($request);
$messageId = $result->get('MessageId');

} catch (Exception $e) {
echo($e->getMessage()."\n");

}

我该如何解决这个问题?

最佳答案

来自 Michael - sqlbotcomment :

Like most servers, Amazon servers use UTC, but it is probably not your time zone that is the problem. Any good library handles the necessary conversions correctly. Your clock simply needs to be set to the correct, current time in the time zone to which it is set, whatever that is. Expired and skewed are typically (though not necessarily) two symptoms of the same problem. Ubuntu? sudo apt-get install ntp. Amazon Linux? sudo yum install ntp.

  • 使用 ntp 同步您的本地时钟

  • 搜索如何在您的操作系统中使用它

关于php - 发件人签名不匹配签名已过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38437748/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com