# Cannot send emails to contacts with AWS SES plugin

**URL:** https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092
**Category:** Mautic 5 Install/Upgrade Support
**Created:** [February 24, 2025, 9:33am UTC](https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092 "2025-02-24T09:33:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mpalatuccieng](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mpalatuccieng/32/13685_2.png) [@mpalatuccieng](https://forum.mautic.org/u/mpalatuccieng)
#### Post date: [February 24, 2025, 9:33am UTC](https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092/1 "2025-02-24T09:33:43Z")

</div>

**Your software**  
My Mautic version is: 5.2.1  
My PHP version is: 8.1.31

**Your problem**  
My problem is:  
I installed mautic using the example docker-compose from the repository: [docker-mautic/examples/fpm-nginx at mautic5 · mautic/docker-mautic · GitHub](https://github.com/mautic/docker-mautic/tree/mautic5/examples/fpm-nginx) .

After installing it correctly, I added the plugin to use AWS-SES , following the directions on the repository: [GitHub - pabloveintimilla/mautic-amazon-ses: Mautic 5 plugin, provides Amazon SES as an email transport and callback to process bounces](https://github.com/pabloveintimilla/mautic-amazon-ses) (I had to install composer, nodejs and npm ).

I have the required symfony/amazon-mailer installed.

I configured Email DSN and clicked Send test email, I received the test email correctly. I tried to send an email to a contact saved in ‘Contacts’ and in the log file ‘prod-2025-02-11.php’ I got this error :

messenger.CRITICAL: Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Removing from transport after 3 retries. Error: “Handling “Symfony\Component\Mailer\Messenger\SendEmailMessage” failed: Connection could not be established with host “localhost:25”: stream\_socket\_client(): Unable to connect to localhost:25 (Connection refused)”

**These errors are showing in the log:**  
messenger.CRITICAL: Error thrown while handling message Symfony\Component\Mailer\Messenger\SendEmailMessage. Removing from transport after 3 retries. Error: “Handling “Symfony\Component\Mailer\Messenger\SendEmailMessage” failed: Connection could not be established with host “localhost:25”: stream\_socket\_client(): Unable to connect to localhost:25 (Connection refused)” {“class”:“Symfony\Component\Mailer\Messenger\SendEmailMessage”,“retryCount”:3,“error”:“Handling "Symfony\Component\Mailer\Messenger\SendEmailMessage" failed: Connection could not be established with host "localhost:25": stream\_socket\_client(): Unable to connect to localhost:25 (Connection refused)”,“exception”:“[object] (Symfony\Component\Messenger\Exception\HandlerFailedException(code: 0): Handling "Symfony\Component\Mailer\Messenger\SendEmailMessage" failed: Connection could not be established with host "localhost:25": stream\_socket\_client(): Unable to connect to localhost:25 (Connection refused) at /var/www/html/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php:130)\n[previous exception] [object] (Symfony\Component\Mailer\Exception\TransportException(code: 0): Connection could not be established with host "localhost:25": stream\_socket\_client(): Unable to connect to localhost:25 (Connection refused) at /var/www/html/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php:154)”} {“hostname”:“afe006cfb306”,“pid”:56}

**Steps I have tried to fix the problem:**  
I also tried another plugin but with the same result. It would seem that Mautic does not read the properties saved in the local.php file. Why does it try to contact [http://localhost:25](http://localhost:25/) and not read the configurations set in the DSN email? It sends test mails from the configuration page correctly. Even when trying with an SMTP server, the result is the same. Is there a problem with the official Docker image? Is there no solution?

---

<div class="post-metadata">

### Author: ![aza\_dhansay](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aza_dhansay/32/13606_2.png) [@aza\_dhansay](https://forum.mautic.org/u/aza_dhansay)
#### Post date: [February 27, 2025, 4:48am UTC](https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092/2 "2025-02-27T04:48:36Z")

</div>

I am facing the same issue with my integration of mautic and amazon

---

<div class="post-metadata">

### Author: ![jodywhitesides](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jodywhitesides/32/12645_2.png) [@jodywhitesides](https://forum.mautic.org/u/jodywhitesides)
#### Post date: [October 6, 2025, 5:55am UTC](https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092/3 "2025-10-06T05:55:37Z")

</div>

Has any solved this issue? I’m running into the exact same issue. I’m using Mautic with Amazon ses+api. I can save the settings, send a test email and it’s successful. But as soon as I attempt to send via a campaign it’s that same problem of Mautic ignoring the transports.

> kubectl exec -n mautic deployment/mautic-app – cat /var/www/html/.env.local kubectl exec -n mautic deployment/mautic-app – php /var/www/html/bin/console debug:config framework mailer cat: /var/www/html/.env.local: No such file or directory command terminated with exit code 1
> 
> Current configuration for “framework.mailer” ============================================
> 
> dsn: ‘%env(urlencoded-dsn:MAUTIC\_MAILER\_DSN)%’ enabled: true message\_bus: null transports: { } headers: { }

I’m finding that no matter what I do to attempt to get Mautic to set the transport to use the DSN setting - it goes empty.

The difference for me is that I’m on v5.1.

Hopefully someone is still paying attention to this thread as it looks like no-one has come to offer a solution for this issue since Feb. Is it a matter of a different Amazon Mailer module? or is there some other spot in Mautic to tweak the install to get it to use the DSN to send emails/campaigns?

---

<div class="post-metadata">

### Author: ![rcarabelli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rcarabelli/32/6807_2.png) [@rcarabelli](https://forum.mautic.org/u/rcarabelli)
#### Post date: [October 9, 2025, 11:24pm UTC](https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092/4 "2025-10-09T23:24:31Z")

</div>

I modified my server to replace Exim’s SMTP and use the SES SMTP.  
Every email that is delivered by my server is managed completely by my server until it’s actually delivered and bridges the local SMTP and connects to SES.

That solution was perfect.

Since I host several mautics, this was a blessing.

---

<div class="post-metadata">

### Author: ![jodywhitesides](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jodywhitesides/32/12645_2.png) [@jodywhitesides](https://forum.mautic.org/u/jodywhitesides)
#### Post date: [October 9, 2025, 11:41pm UTC](https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092/5 "2025-10-09T23:41:50Z")

</div>

That’s awesome. I’m curious to know if you have a blueprint of how you managed to do that? Would it translate to Kubernetes or Microk8s? Would you be willing to share? I’d rather use SES+API rather than SMTP.

---

<div class="post-metadata">

### Author: ![rcarabelli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rcarabelli/32/6807_2.png) [@rcarabelli](https://forum.mautic.org/u/rcarabelli)
#### Post date: [October 9, 2025, 11:55pm UTC](https://forum.mautic.org/t/cannot-send-emails-to-contacts-with-aws-ses-plugin/35092/6 "2025-10-09T23:55:31Z")

</div>

I have full root access and WHM, did it via the WHM Exim editor (you don’t need whm) and by adding a file to let the server know which accounts should use the server smtp vs which to use SES (including SMTP credentials). The best part is that each of my clients can use their own SES accounts.

But this seems so reliable that I am thinking about providing a mautic hosting service.
