- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
嗨,我的代码几天前运行完美,我今天检查使用 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 - sqlbot的 comment :
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/
我是一名优秀的程序员,十分优秀!