Skip to content

Symfony Amazon SES Mailer does not work(Authentication issue) #36956

Closed
@neok

Description

@neok

Symfony version(s) affected: Symfony 5.0.8

Description
Symfony Amazon SES mailer not sending emails.
Deprecated signature is used, we should migrate to Signature Version 4 signing process

Unable to send an email: The security token included in the request is invalid. (code 0).

Response from amazon

   +"Type": "Sender"
    +"Code": "InvalidClientTokenId"
    +"Message": "The security token included in the request is invalid."

it seems like they do not support V3 Authentication anymore, or something else. I tried with multiple different credentials and still, it does not work.

How to reproduce

        $email = (new Email())
            ->from('hello@mydomian.com')
            ->to(new Address('myemail@gmail.com'))
            ->subject('Thanks for signing up!')

            ->text('Hello')
            ->html('Hello');

        $this->mailer->send($email);

Config

framework:
    mailer:
        dsn: 'ses+api://KEY:SECRET@default?region=eu-central-1'

Possible Solution
Change Authentication to v4

Additional context
I tried to send emails with
amazon PHP sdk

       $this->client = new SesClient([
            'credentials' => [
                'key' => 'KEY',
                'secret' => 'SECRET'
            ],
            'version' => 'latest',
            'region'  => 'eu-central-1'
        ]);

it does work, they are using V4 authorization(for more than two years).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions