0

I am using PHP 8.1.21 and Laravel 10.14.1 in a pretty simple setup. I've implemented AWS SES for outgoing email before with no trouble but in this case I get the following error:

Aws\Common\Client\AbstractClient::__construct(): Argument #1 ($credentials) must be of type Aws\Common\Credentials\CredentialsInterface, array given, called in /home/site/DOMAIN.COM/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php on line 252

I have AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION set in the .env and obviously the SDK installed. I am sending the email using a Laravel Notification that works flawlessly in the local server with Mailpit.

Any advice much appreciated.

Update: So it looks like this is because I have the aws-sdk-php 2.8 version. When I try and update it to 3.* though I get this error:

- aws/aws-sdk-php[3.0.1, ..., 3.3.4] require guzzlehttp/psr7 ~1.0 -> found guzzlehttp/psr7[1.0.0, ..., 1.9.1] 
but the package is fixed to 2.5.0 (lock file version) by a partial update and that version does not match. 
Make sure you list it as an argument for the update command.

So far I can't get a set of dependencies that resolve.

3
  • Are you using the built-in SES support (i.e. MAIL_MAILER=ses) or something custom? Commented Jul 19, 2023 at 1:50
  • Does this answer your problem: stackoverflow.com/questions/33594052/… Commented Jul 19, 2023 at 2:11
  • @ceejayoz Yep I am using the built-in SES support with both these set in .env MAIL_MAILER=ses, MAIL_DRIVER=ses. In my composer.json ai I have require .. ."aws/aws-sdk-php": "^2.8" so I'll try and force V3.0 or download it and see. Commented Jul 19, 2023 at 3:26

1 Answer 1

2

So I still don't know why the aws-sdk-php was installed at such an old version by Composer and I had to delete Guzzle to get it working by running the below. Guzzle version still the same as it was, but now it works:

composer require "aws/aws-sdk-php:3.*" --update-with-all-dependencies

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.