Reputation: 1185
I'm building a website with Laravel, done a plain install of Laravel 5.1 and planning to send emails form my website using Amazon Webservices SES.
As Laravel documentation states it's quite straightforward, after installing Amazon PHP SDK using composer all you need to do is configure credentials inside the config/mail.php and services.php like this :
'ses' => [
'key' => 'your-ses-key',
'secret' => 'your-ses-secret',
'region' => 'ses-region', // e.g. us-east-1
],
I put my amazon credentials inside the .env file in the root of the Laravel installation, but whenever I try to send an email with the Laravel mailer class I get this error:
"Error retrieving credentials from the instance profile metadata server"
Double checked the credentials on Amazon WS Console but still got the problem.
Any hint?
Upvotes: 1
Views: 887
Reputation: 1185
Found that Amazon SDK needs the keys loaded in the ENV variable and named like :
AWS_ACCESS_KEY_ID =thatweirdkeystring
AWS_SECRET_ACCESS_KEY =theotherweirdsecretkey
after renaming the keys and modifying the services.php file to use that keys with env() helper everything worked.
Upvotes: 1