# AxiosError: Request failed with status code 400

**URL:** <https://help.nextcloud.com/t/axioserror-request-failed-with-status-code-400/217651>\
**Category:** ℹ️ Support\
**Tags:** nc30\
**Created:** [February 16, 2025, 9:21pm UTC](https://help.nextcloud.com/t/axioserror-request-failed-with-status-code-400/217651 "2025-02-16T21:21:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nano11bravo](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nano11bravo/32/69205_2.png) [@nano11bravo](https://help.nextcloud.com/u/nano11bravo)\
**Post date:** [February 16, 2025, 10:47pm UTC](https://help.nextcloud.com/t/axioserror-request-failed-with-status-code-400/217651/2 "2025-02-16T22:47:03Z")

</div>

I was receiving this error message while trying to use a 3rd party mailer service like mailgun/mailersend and resorted to using Postfix smtp relaying for a temporary fix.

Just to be clear my `config.php` looked like this before the changes.

```auto
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => 'smtp.mydomain.com',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '587',
  'mail_from_address' => 'noreply',
  'mail_domain' => 'mydomain.com',

```

After reading through the documentation and scrubbing my `config.php` I found the solution was to add the following to my config.

```auto
'mail_smtptimeout' => 30,
  'mail_smtpname' => 'user@smtphost.com',
  'mail_smtppassword' => 'supersecretpassword',

```

I’ll post the system details for fun.

**Nextcloud**  
Nextcloud Hub 9 (30.0.6)

**PHP**  
8.3.17

**OS**  
Ubuntu 22.04.5 LTS x86\_64  
Linux 5.15.0-131-generic x86\_64

So to clarify I resolved my issue by manually adding the smtp credentials to the configuration file (yes I know its a security risk but this isn’t a production host). If the Administration Portal → Basic Settings does any sort of credential saving it wasn’t properly for me (I ensured my config.php could be written by NextCloud). I suppose this should be looked at further by someone who knows that area of the NextCloud source and maybe we can even add something to the Basic Settings page to allow for more of these [configuration](https://docs.nextcloud.com/server/30/admin_manual/configuration_server/email_configuration.html) parameters found in the documentation.

I hope this helps someone as much as it did me.

[https://docs.nextcloud.com/server/30/admin\_manual/configuration\_server/email\_configuration.html](https://docs.nextcloud.com/server/30/admin_manual/configuration_server/email_configuration.html)

---

_[View the full topic](https://help.nextcloud.com/t/axioserror-request-failed-with-status-code-400/217651)._
