# Problem to setup mail with mailgun

**URL:** https://forum.mautic.org/t/problem-to-setup-mail-with-mailgun/32870
**Category:** Mautic 5 Install/Upgrade Support
**Created:** [July 25, 2024, 11:08am UTC](https://forum.mautic.org/t/problem-to-setup-mail-with-mailgun/32870 "2024-07-25T11:08:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ezohiko](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@ezohiko](https://forum.mautic.org/u/ezohiko)
#### Post date: [July 25, 2024, 11:08am UTC](https://forum.mautic.org/t/problem-to-setup-mail-with-mailgun/32870/1 "2024-07-25T11:08:31Z")

</div>

**Your software**  
My Mautic version is: 5.0.4  
My PHP version is: 8.1.29  
My Database type and version is: Mariadb 10.5

**Your problem**  
My problem is:  
When I try to send a test, I have this message :  
Failed to authenticate on SMTP server with username “[xxx@xxx.co](mailto:xxx@xxx.co)” using the following authenticators: “LOGIN”, “PLAIN”. Authenticator “LOGIN” returned “Expected response code “235” but got code “535”, with message “535 Authentication failed”.”. Authenticator “PLAIN” returned “Expected response code “235” but got empty code.”.

I try from cli with swaks, it works.

My DSN : smtp://xxx@xxx.co:SECRET@smtp.eu.mailgun.org:587?encryption=tls

---

<div class="post-metadata">

### Author: ![ezohiko](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@ezohiko](https://forum.mautic.org/u/ezohiko)
#### Post date: [July 25, 2024, 2:58pm UTC](https://forum.mautic.org/t/problem-to-setup-mail-with-mailgun/32870/2 "2024-07-25T14:58:59Z")

</div>

When mautic write the dsn in the file config/local.php, some letters are changing, @ become %40, and it doesn’t work 😉

You have to edit the file manualy !

---

<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 27, 2024, 2:59am UTC](https://forum.mautic.org/t/problem-to-setup-mail-with-mailgun/32870/3 "2024-07-27T02:59:36Z")

</div>

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