# Mautic 5 showing error when setup SMTP in DNS to use self hosted ESP mta server

**URL:** https://forum.mautic.org/t/mautic-5-showing-error-when-setup-smtp-in-dns-to-use-self-hosted-esp-mta-server/32910
**Category:** Mautic 5 Install/Upgrade Support
**Created:** [July 29, 2024, 12:26am UTC](https://forum.mautic.org/t/mautic-5-showing-error-when-setup-smtp-in-dns-to-use-self-hosted-esp-mta-server/32910 "2024-07-29T00:26:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![duplexcleaning](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/duplexcleaning/32/7211_2.png) [@duplexcleaning](https://forum.mautic.org/u/duplexcleaning)
#### Post date: [July 29, 2024, 12:26am UTC](https://forum.mautic.org/t/mautic-5-showing-error-when-setup-smtp-in-dns-to-use-self-hosted-esp-mta-server/32910/1 "2024-07-29T00:26:48Z")

</div>

**Your software**  
My Mautic version is: v5.1.0  
My PHP version is: 8.0  
My Database type and version is: 8.0.30

**Your problem**  
My problem is:  
Expected response code “250” but got code “502”, with message “502 503 Authentication failure: invalid API key”.

These errors are showing in the log:  
[26-Jul-2024 05:57:49 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 40960 bytes) in mautic/vendor/symfony/dependency-injection/Compiler/InlineServiceDefinitionsPass.php on line 197

Steps I have tried to fix the problem:  
tried to use different ports such as: 587 or 2525 or 8025

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [July 29, 2024, 8:17pm UTC](https://forum.mautic.org/t/mautic-5-showing-error-when-setup-smtp-in-dns-to-use-self-hosted-esp-mta-server/32910/2 "2024-07-29T20:17:59Z")

</div>

What transport are you using. By the looks of the message there is an issue with your password/api key.

---

<div class="post-metadata">

### Author: ![duplexcleaning](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/duplexcleaning/32/7211_2.png) [@duplexcleaning](https://forum.mautic.org/u/duplexcleaning)
#### Post date: [July 29, 2024, 11:28pm UTC](https://forum.mautic.org/t/mautic-5-showing-error-when-setup-smtp-in-dns-to-use-self-hosted-esp-mta-server/32910/3 "2024-07-29T23:28:04Z")

</div>

Hi matic, thanks for your response.  
By the way, I have solved this issue because it was Mautic bug that displays “lock” icon which is actually rendered in escape character forming icon visually in the password field, hence that lock icon should be removed before entering the correct password then click save button in Mautic 5.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)
#### Post date: [July 31, 2024, 11:28am UTC](https://forum.mautic.org/t/mautic-5-showing-error-when-setup-smtp-in-dns-to-use-self-hosted-esp-mta-server/32910/4 "2024-07-31T11:28:06Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
