# messenger.CRITICAL: Error

**URL:** <https://forum.mautic.org/t/messenger-critical-error/32560>\
**Category:** Product Support\
**Created:** [June 26, 2024, 7:57pm UTC](https://forum.mautic.org/t/messenger-critical-error/32560 "2024-06-26T19:57:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaroslav.huss](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jaroslav.huss/32/12244_2.png) [@jaroslav.huss](https://forum.mautic.org/u/jaroslav.huss)\
**Post date:** [June 26, 2024, 7:57pm UTC](https://forum.mautic.org/t/messenger-critical-error/32560/1 "2024-06-26T19:57:26Z")

</div>

**Your software**  
My Mautic version is: latest via docker pull mautic  
My PHP version is: PHP version comes from official docker image of Mautic  
My Database type and version is: latest via docker pull mysql

**Your problem**  
My problem is:  
If I go settings \> configuration \> email settings \> and hit “send test mail” - I will receive test email correctly signed by DKIM/SPF. Everything works as expected!

If I create a segment email and hit “send test email” or send real email to the segment, nothing is delivered and in the console I will get the following error:

These errors are showing in the log:  
[2024-06-26T19:40:46.607330+00:00] 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”:“f90bbc2b2e39”,“pid”:56}

Steps I have tried to fix the problem:  
I was trying to change the SMTP provider but somehow there is no effect. Still getting this error.

Please… I am totally lost. I do not understand why the test email via config works (so SMTP is fine!) but real email via Email component are not delivered…

Using docker compose up -d with latest mysql and mautic image.

Thank you!

---

<div class="post-metadata">

**Author:** ![wendelwrs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wendelwrs/32/11907_2.png) [@wendelwrs](https://forum.mautic.org/u/wendelwrs)\
**Post date:** [September 11, 2024, 3:37pm UTC](https://forum.mautic.org/t/messenger-critical-error/32560/2 "2024-09-11T15:37:22Z")

</div>

Hi there,

Your scheme must be “`mautic+ses+api`” after that validation of client details must work.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 12, 2024, 11:49am UTC](https://forum.mautic.org/t/messenger-critical-error/32560/3 "2024-09-12T11:49:58Z")

</div>

Hi, that depends what plugin you use. Some plugin requires ses+api, some mautic+ses+api.  
Read the docs of your plugin or the symfony docs related to email sending.  
However in this case I think this is an SMTP you connect via port 25. That might be blocked by your provider.  
You didn’t mention if you actually received the test email.
