我尝试使用AWS SES sendEmail方法发送邮件,并且遇到错误。我已阅读此问题:AWS SDK Guzzle error when trying to send a email with SES使用SES发送电子邮件时出现AWS SDK Guzzle错误
我正在处理一个非常类似的问题。原始海报表明他们有解决方案,但没有发布解决方案。
我的代码:
$response = $this->sesClient->sendEmail('[email protected]',
array('ToAddresses' => array($to)),
array('Subject.Data' => array($subject), 'Body.Text.Data' => array($message)));
狂饮码产生的误差(从aws/Guzzle/Service/Client.php
):产生
return $this->getCommand($method, isset($args[0]) ? $args[0] : array())->getResult();
错误:
Catchable fatal error: Argument 2 passed to Guzzle\Service\Client::getCommand() must be of the type array, string given
综观狂饮代码,我可以看到如果设置了args[0]
,那么对getCommand
的呼叫将发送一个字符串并且是一个字符串。如果没有设置args[0]
,则发送一个空数组。
我在这里错过了什么?