dimanche 29 mars 2015

AWS SES Guzzle Error when sending email

I have set up AWS Ses service using PHP SDK:



$this->client = SesClient::factory([
'key' => $params['key'],
'secretKey' => $params['secret_key'],
'region' => 'eu-west-1',
'base_url' => 'http://ift.tt/1Czzwtj',
]);

$this->client->sendEmail($this->params());

public function params() {
array(
'Source' => 'verified@gmail.com',
'Destination' => array(
'ToAddresses' => array('receiver@yahoo.com')
),
'Message' => array(
'Subject' => array(
'Data' => 'SES Testing',
'Charset' => 'UTF-8',
),
// Body is required
'Body' => array(
'Text' => array(
'Data' => 'My plain text email',
'Charset' => 'UTF-8',
),
'Html' => array(
'Data' => '<b>My HTML Email</b>',
'Charset' => 'UTF-8',
),
),
),
'ReplyToAddresses' => array( 'replyTo@email.com' ),
'ReturnPath' => 'bounce@email.com'
);
}


After trying to send email, I receive this error message:



exception 'Guzzle\Http\Exception\CurlException' with message
'[curl] 23: Failed writing body (0 != 86) [url] http://ift.tt/1Czzwtj'
in C:\xampp\htdocs\myProject\protected\lib\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php:338


Anyone know how to fix that error?





Aucun commentaire:

Enregistrer un commentaire