title: Amazon SES error: "Error executing "SendEmail" on "https://email.us-west-2.amazonaws.com"; AWS HTTP error
body: <p>Could anyone please shed some light on what would be causing these errors?</p>
  
  <p>I'm using Google App Engine on a development server. First I got this error:</p>
  
  <blockquote>
    <p>The email was not sent. Error message: Error executing "SendEmail" on
    "<a href="https://email.us-west-2.amazonaws.com" rel="nofollow noreferrer">https://email.us-west-2.amazonaws.com</a>"; AWS HTTP error: No system CA
    bundle could be found in any of the the common system locations. PHP
    versions earlier than 5.6 are not properly configured to use the
    system's CA bundle by default. In order to verify peer certificates,
    you will need to supply the path on disk to a certificate bundle to
    the 'verify' request option:
    <a href="http://docs.guzzlephp.org/en/latest/clients.html#verify" rel="nofollow noreferrer">http://docs.guzzlephp.org/en/latest/clients.html#verify</a>. If you do not
    need a specific certificate bundle, then Mozilla provides a commonly
    used CA bundle which can be downloaded here (provided by the
    maintainer of cURL):
    <a href="https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt" rel="nofollow noreferrer">https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt</a>.
    Once you have a CA bundle available on disk, you can set the
    'openssl.cafile' PHP ini setting to point to the path to the file,
    allowing you to omit the 'verify' request option. See
    <a href="http://curl.haxx.se/docs/sslcerts.html" rel="nofollow noreferrer">http://curl.haxx.se/docs/sslcerts.html</a> for more information.</p>
  </blockquote>
  
  <p>Then I added <code>google_app_engine.enable_curl_lite = 1</code> to php.ini and reduced the error to:</p>
  
  <blockquote>
    <p>The email was not sent. Error message: Error executing "SendEmail" on "<a href="https://email.us-west-2.amazonaws.com" rel="nofollow noreferrer">https://email.us-west-2.amazonaws.com</a>"; AWS HTTP error: curl_multi_init</p>
  </blockquote>
  
  <p>I'm beginning to understand that using SES on GAE might require a few tweaks??? What can I do?</p>
  
  <p>My code is 99% from the Amazon documentation. The only difference is that I've hardcoded the credentials array in <code>$client</code>.</p>
  
  <pre><code>&lt;?php
  
  // Replace path_to_sdk_inclusion with the path to the SDK as described in
  // http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/basic-usage.html
  define('REQUIRED_FILE','../aws/aws-autoloader.php');
  
  // Replace sender@example.com with your "From" address.
  // This address must be verified with Amazon SES.
  define('SENDER', 'me@verified.sender.address.com');
  
  // Replace recipient@example.com with a "To" address. If your account
  // is still in the sandbox, this address must be verified.
  define('RECIPIENT', 'me@verified.receiver.address.com');
  
  // Replace us-west-2 with the AWS region you're using for Amazon SES.
  define('REGION','us-west-2');
  
  define('SUBJECT','Amazon SES test (AWS SDK for PHP)');
  define('BODY','This email was sent with Amazon SES using the AWS SDK for PHP.');
  
  require REQUIRED_FILE;
  
  use Aws\Ses\SesClient;
  
  $client = SesClient::factory(array(
      'version'=&gt; 'latest',
      'region' =&gt; REGION,
      'credentials' =&gt; array(
          'key' =&gt; 'xxx',
          'secret'  =&gt; 'xxx',
      )
  ));
  
  $request = array();
  $request['Source'] = SENDER;
  $request['Destination']['ToAddresses'] = array(RECIPIENT);
  $request['Message']['Subject']['Data'] = SUBJECT;
  $request['Message']['Body']['Text']['Data'] = BODY;
  
  try {
      $result = $client-&gt;sendEmail($request);
      $messageId = $result-&gt;get('MessageId');
      echo("Email sent! Message ID: $messageId"."\n");
  
  } catch (Exception $e) {
      echo("The email was not sent. Error message: ");
      echo($e-&gt;getMessage()."\n");
  }
  
  ?&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Once deployed, this works without any edit to php.ini...??</p>