How to set AWS SES identity in Laravel 8

  amazon-ses, amazon-web-services, laravel, php

I am getting the error message User arn:aws:iam:blabla:user/blabla is not authorized to preform ses:SendRawEmail on resource arn:aws:ses:locationLblabla:identity/[domain-of-the-to-address].com my DevOps informs me that [domain-of-the-to-address] should me a specific/our domain. The only way I can find to manipulate that is changing the to address. How do i properly set that? I have tried that following

// services.php

return [
  'ses' => [
    'key' => '...',
    'secret' => '...',
    'region' => '...',
    'options' => [
      'SourceARN' => 'arn:aws:ses:locationLblabla:identity/[correct-domain].com'
      'Source' => '[email protected][correct-domain].com'
    ],
  ]
];

and

// MyMailable.php

$this->withSwiftMessage(function (Swift_Message $message) {
  $message->getHeaders()->addTextHeader('X-SES-SOURCE-ARN', 'arn:aws:ses:locationLblabla:identity/[correct-domain].com');
});

Source: Laravel

Leave a Reply