Am having some issues getting AWS SES working per below; I want to send an email to users from my website. Looks like the credentials are not being validated, however I have used the correct credentials generated from an IAM (I also tried the server root keys and it gave me the same error). I have run out of ideas of how to resolved/ debug any further so any steer would be greatly appreciated.
Error Received on Execution:
Error retrieving credentials from the instance profile metadata server. (Client error: 404)
Steps Taken
I have setup SES and validated the email addresses etc
I have created a IAM profile with 'Full access to SES'
I have installed the AWS SDK for php using the phar file
I have written the php code below providing the correct security access code directly of the SES
require 'aws/aws.phar'; use Aws\Ses\SesClient; //More code here $client = SesClient::factory(array( 'key' => 'xxxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxx', 'region' => 'us-west-2', 'version' => '2010-12-01' )); //code to build the $msg here as array try{ $result = $client->sendEmail($msg); //save the MessageId which can be used to track the request $msg_id = $result->get('MessageId'); echo("MessageId: $msg_id"); //view sample output print_r($result); } catch (Exception $e) { echo($e->getMessage()); } //view the original message passed to the SDK print_r($msg);
Thank you for your help in advance - this is always a great community!! Please let me know if i can provide anything else
John