發生奇怪的錯誤我不知道如何解決。 這是錯誤:AWS SDK在嘗試使用SES發送電子郵件時引發錯誤
(!) Catchable fatal error: Argument 2 passed to Guzzle\Service\Client::getCommand() must be an array, string given, called in phar://C:/wamp/www/PHPCodeLance/WebTech/Projects/MIB v2/lib/aws/aws.phar/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php on line 93 and defined in phar://C:/wamp/www/PHPCodeLance/WebTech/Projects/MIB v2/lib/aws/aws.phar/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php on line 113
Call Stack
# Time Memory Function Location
1 0.0009 676280 {main}() ..\test.php:0
2 0.0557 3311632 Aws\Ses\SesClient->send_email() ..\test.php:30
3 0.0557 3312128 Aws\Common\Client\AbstractClient->__call() ..\test.php:30
4 0.0557 3312208 Guzzle\Service\Client->__call() ..(null):103
5 0.0557 3312296 Guzzle\Service\Client->getCommand() ..(null):93
這是我使用的代碼(直接從AWS頁)
$client = SesClient::factory(array(
'key' => '',
'secret' => '',
'region' => 'us-east-1'
));
$response = $client->send_email(
'[email protected]', // Source (aka From)
array('ToAddresses' => array(// Destination (aka To)
'[email protected]'
)),
array(// Message (short form)
'Subject.Data' => 'Email Test ' . time(),
'Body.Text.Data' => 'This is a simple test message ' . time()
)
);
// Success?
var_dump($response->isOK());
更新!!!:修正了上述問題
,現在我得到了SSL證書問題:
Guzzle\Http\Exception\CurlException: [curl] 60: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed [url] https://email.us-east-1.amazonaws.com/ in phar://C:/wamp/www/PHPCodeLance/WebTech/Projects/MIB v2/lib/aws/aws.phar/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php on line 578
在此先感謝
如果您提到您如何解決第一個錯誤,以便下一個搜索它的人可以實際使用此頁而不是沒有任何信息,那將會更有幫助。 – JPR