Email DSN configuring Amazon SES-API error

Your software
My Mautic version is: 5.0.4
My PHP version is: 8.1.27
My Database type and version is: mysql Ver 15.1 Distrib 10.5.23-MariaDB, for Linux (x86_64) using EditLine wrapper

Your problem
My problem is: Is that after installing Mautic in AWS EC2 with AWS Linux I got error in configuring the email settings with AWS SES

These errors are showing in the log:

Here are the errors I got:

image

after installing the amazon-mailer:

Steps I have tried to fix the problem:

work on which is the next thing to proceed in this error I have installed everything and I need some steps further I even created another policy on Amazon SES.

error when I installit

Got this error:

After migration from Mautic 4.1.11 to 5.1 our AWS SES email configuration was not working anymore. As a result campaigns got paused and all test mails resulted in errors.

After some investigation we found out that the DSN field in the email settings contained ‘mautic.transport.amazon’. After only changing this field to ‘smtp’ the email configuration started to work again. Only had to start the paused campaigns again.

Hope this helps.

2 Likes

I need help, I tested all configurations and even tried updating Symfony, but I couldn’t solve the problem. Thank you in advance."

If you want to use SES API, then set Host to “default” and add option for region like below image.

Make sure you have installed mailer that supports SES API like symfony/amazon-mailer.
It can be installed with composer require symfony/amazon-mailer and then clear cache with php bin/console cache:clear.

I’m trying to run the command composer require symfony where my project is, which is on a shared server."

Problem 1
- symfony/redis-messenger v6.0.19 requires ext-redis * → it is missing from your system. Install or enable PHP’s re dis extension.
- mautic/core-lib 5.0.0-dev requires symfony/messenger ~5.4 → satisfiable by symfony/messenger[v5.4.35].
- symfony/messenger v5.4.35 requires symfony/redis-messenger ^5.1|^6.0 → satisfiable by symfony/redis-messenger[v6. 0.19].
- Root composer.json requires mautic/core-lib ^5.0 → satisfiable by mautic/core-lib[5.0.0-dev].

To enable extensions, verify that they are enabled in your .ini files:
- /opt/cpanel/ea-php82/root/etc/php.ini
- /opt/cpanel/ea-php82/root/etc/php.d/10-opcache.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-bcmath.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-bz2.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-calendar.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-ctype.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-curl.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-dom.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-exif.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-fileinfo.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-ftp.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-gd.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-gettext.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-gmp.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-iconv.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-imap.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-intl.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-mbstring.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-mysqlnd.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-odbc.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-pdo.ini
- /opt/cpanel/ea-php82/root/etc/php.d/20-pgsql.ini

You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-redis to temporarily ignore these required extensio ns.
You can also try re-running composer require with an explicit version constraint, e.g. “composer require symfony/amazon- mailer:*” to figure out if any version is installable, or “composer require symfony/amazon-mailer:^2.1” if you know whic h you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Can you try with --ignore-platform-reqs?
eg composer require symfony/amazon-mailer --ignore-platform-reqs

different error

At this point just use pm-pmaas/etailors_amazon_ses which can be installed without composer.

Steps:

  1. Go to plugins folder with cd plugins
  2. Clone pm-pmaas/etailors_amazon_ses repository into plugins folder with git clone https://github.com/pm-pmaas/etailors_amazon_ses.git AmazonSesBundle
    There should be now new folder named AmazonSesBundle in plugins folder.
  3. Go back to Mautic root folder with cd ..
  4. Clear Mautic cache with php bin/console cache:clear
  5. Set scheme to mautic+ses+api instead of ses+api

After clearing Mautic cache, go SettingsIntegrationsPlugins → Click on Install/Upgrade Plugins button, it should list Amazon SES after that

Now, when I set it to mautic+ses+api an error occurs, and when I set it to ses+api the page breaks.

Looks like you already have different mailer installed.
Please delete AmazonSESBundle/AmazonSesBundle from plugins folder and try again these steps I provided earlier.
Make sure there is only AmazonSesBundle (not AmazonSESBundle or anything else).

This is what pm-pmaas/etailors_amazon_ses looks like

The plugin doesn’t appear, but it seems to be active because the error now was different.

Set Host to “default”
Set Port to empty

DSN should look like mautic+ses+api://<AWS_ACCESS_KEY>:<AWS_SECRET_KEY>@default?region=<AWS_REGION>


Where can I check the log?

You can check logs under <Mautic root>/var/logs

Do you have production access enabled in Amazon SES? Not in sandbox.

If credentials are for SMTP, then you need create IAM user and attach SES policy to this user, then create API credentials for this IAM user.

[2024-11-08T18:22:57.833325+00:00] mautic.CRITICAL: Uncaught PHP Exception AsyncAws\Core\Exception\Http\NetworkException: “Could not contact remote server.” at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/async-aws/core/src/Response.php line 161 {“exception”:“[object] (AsyncAws\Core\Exception\Http\NetworkException(code: 0): Could not contact remote server. at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/async-aws/core/src/Response.php:161)\n[previous exception] [object] (Symfony\Component\HttpClient\Exception\TransportException(code: 0): Received HTTP/0.9 when not allowed for "https://email-smtp.sa-east-1.amazonaws.com:465/v2/email/outbound-emails\”. at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/symfony/http-client/Chunk/ErrorChunk.php:65)\n[previous exception] [object] (Symfony\Component\HttpClient\Exception\TransportException(code: 0): Received HTTP/0.9 when not allowed for "https://email-smtp.sa-east-1.amazonaws.com:465/v2/email/outbound-emails\“. at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/symfony/http-client/Response/CurlResponse.php:323)”} {“hostname”:“sh-pro14.hostgator.com.br”,“pid”:82227}
[2024-11-08T18:23:35.219936+00:00] mautic.CRITICAL: Uncaught PHP Exception AsyncAws\Core\Exception\Http\NetworkException: “Could not contact remote server.” at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/async-aws/core/src/Response.php line 161 {“exception”:“[object] (AsyncAws\Core\Exception\Http\NetworkException(code: 0): Could not contact remote server. at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/async-aws/core/src/Response.php:161)\n[previous exception] [object] (Symfony\Component\HttpClient\Exception\TransportException(code: 0): Received HTTP/0.9 when not allowed for "https://email-smtp.sa-east-1.amazonaws.com:465/v2/email/outbound-emails\”. at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/symfony/http-client/Chunk/ErrorChunk.php:65)\n[previous exception] [object] (Symfony\Component\HttpClient\Exception\TransportException(code: 0): Received HTTP/0.9 when not allowed for "https://email-smtp.sa-east-1.amazonaws.com:465/v2/email/outbound-emails\“. at /home2/bmdlco83/marketing.fibradobrasil.com.br/vendor/symfony/http-client/Response/CurlResponse.php:323)”} {“hostname”:“sh-pro14.hostgator.com.br”,“pid”:85327}

I checked my AMAZONSES configuration, and everything is correct.

Attached is the log from my Mautic. Can you help?