Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have used the following code for sending mail using php using amazon ec2, but I only see 'aatest' as the result, and doesn't get any incoming email. Btw, I have already included ses.php, and have validated the email, and double confirm that accesskey, and accesskey are the correct one. Can anyone suggest way for debugging it?

$con=new SimpleEmailService('accesskey','accesskey');

$m = new SimpleEmailServiceMessage();
$m->setSubject('Hello, world!');
$m->setMessageFromString('This is the message body.');
echo 'test';
share|improve this question
Have you tried putting error_reporting(E_ALL); at the top of your code? Have you tried disabling the SSL certificate check by doing $con->enableVerifyHost(false); $con->enableVerifyPeer(false);? – ub3rst4r Sep 17 '12 at 3:33
Yes, it works by adding $con->enableVerifyHost(false); $con->enableVerifyPeer(false); ! What is the reason for that? Btw, could you post it as an answer, so I could accept it :) – william007 Sep 17 '12 at 5:10
up vote 2 down vote accepted

Disable the SSL certificate check with the following lines:


The reason its failing the SSL certificate verification is because the certificate for SES is not recognized by the default CA (Certificate Authority) loaded with cURL. I believe you have to generate your own certificate for AWS by going to and clicking on "X.509 Certificates" and "Create a new certificate". You will then be able to download the certificate. However, unless your knowledgeable about PHP you won't be able to include the certificate file with that PHP class. So your best just to disable the verification.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.