AxiosError: Request failed with status code 400

Running on NC31, I have the same error message.
My configuration:
‘mail_smtphost’ => ‘localhost’,
‘mail_smtpport’ => ‘25’,
‘mail_smtpsecure’ => ‘’

This should not use TLS, but the Exim4 logfile shows
“TLS error on connection from (domain.com) [127.0.0.1] (gnutls_handshake): Decryption has failed.”

The same local SMTP is configured for the mail app as well, and works there as expected.

I have the same error, edited config with timeout and smtp mode and have a mail set in the admin account and it still doesnt work.

LO QUE ME FUNCIONÓ ES: En la página de “información personal” agregué la misma dirección de correo electrónico que usé en la configuración SMTP. En mi caso, esa información estaba en blanco. Al agregarla, el error desapareció y recibí el correo de confirmación.


WHAT WORKED FOR ME IS: On the “personal information” page I added the same email address as the one used in the SMTP configuration. In my case, that information was blank. When I added it, the error disappeared and I received the confirmation email.

1 Like

I was running into this issue as well, and none of the above helped me. I eventually found out that the email settings I specified in docker-compose.yml were the problem, even though the settings were correct.

If you built your Nextcloud docker instance using docker-compose.yml and you pre-specified your email settings there, try re-building your docker container without them, then manually enter your email settings via the web interface. That (as well as checking everything else specified above) may help your problem.

Hi,
That was the solution for me.
Same email in the fisrt user created personal information and in the Test and verify email settings Send Email.
No config.php modification.
Thank’s and good luck !

Same here, - Fresh install latest 30 version, no any apps add, just fresh install and fix all what i find in admin page, - i try all solutions, i use - ‘mail_smtptimeout’ => 30,, yes i put mail adress to admin account, still same, i try port 25 , i try 587, i copy from config.php - mail settings from my old still working nextcloud 28. Still! Not working and get this - AxiosError: Request failed with status code 400 nextcloud. Please Nextcloud team, can You check this?? My setup - Almalinux server 9.5, Postgresql 16, php 8.3, mail server Exchange 2019- All fine exept mail settings. And what i see people have same problems wit Debian linux systems

2 Likes

None of these solutions worked for me aswell. It only works when I turn off authorization. Until I upgraded to NC28 I had no issues with notifications. I also tried fresh install on Debian12 with NC31 and it doesn’t work. IMHO NC has a problem when trying to authorize on some SMTP servers (I’ve tried Postfix and Exchange).

I add myself to the list.

Fresh latest AIO installation (NC31):

2025-03-13T08:26:34.090203582Z NOTICE: PHP message: 404 Not Found
2025-03-13T08:26:34.090239296Z Type: Slim\Exception\HttpNotFoundException
2025-03-13T08:26:34.090244033Z Code: 404
2025-03-13T08:26:34.090247718Z Message: Not found.
2025-03-13T08:26:34.090251184Z File: /var/www/docker-aio/php/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php
2025-03-13T08:26:34.090254929Z Line: 76
2025-03-13T08:26:34.090258365Z Trace: #0 /var/www/docker-aio/php/vendor/slim/slim/Slim/Routing/RouteRunner.php(62): Slim\Middleware\RoutingMiddleware->performRouting(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090262611Z #1 /var/www/docker-aio/php/vendor/slim/csrf/src/Guard.php(482): Slim\Routing\RouteRunner->handle(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090266407Z #2 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(177): Slim\Csrf\Guard->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Slim\Routing\RouteRunner))
2025-03-13T08:26:34.090270974Z #3 /var/www/docker-aio/php/vendor/slim/twig-view/src/TwigMiddleware.php(117): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090274869Z #4 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(129): Slim\Views\TwigMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
2025-03-13T08:26:34.090278655Z #5 /var/www/docker-aio/php/src/Middleware/AuthMiddleware.php(36): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090282321Z #6 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(280): AIO\Middleware\AuthMiddleware->__invoke(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
2025-03-13T08:26:34.090302250Z #7 /var/www/docker-aio/php/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(77): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090306076Z #8 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(129): Slim\Middleware\ErrorMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
2025-03-13T08:26:34.090309842Z #9 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(73): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090314559Z #10 /var/www/docker-aio/php/vendor/slim/slim/Slim/App.php(209): Slim\MiddlewareDispatcher->handle(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090318184Z #11 /var/www/docker-aio/php/vendor/slim/slim/Slim/App.php(193): Slim\App->handle(Object(GuzzleHttp\Psr7\ServerRequest))
2025-03-13T08:26:34.090321780Z #12 /var/www/docker-aio/php/public/index.php(190): Slim\App->run()
2025-03-13T08:26:34.090325285Z #13 {main}
2025-03-13T08:26:34.090328620Z Tips: To display error details in HTTP response set "displayErrorDetails" to true in the ErrorHandler constructor.

‘mail_smtptimeout’ => 30,

adding this line resolved my issue

This ended up being my issue! Added the email address to my admin user and it resolved the 400 error and the test email was successfully sent. No manual configuration needed.

I’m using Nextcloud AIO - Hub version 31.0.0

Hm, I tried that but it doesn’t work on my end. Do you use the exact email address “From address” for the smtp server and admins email address?

Yes, that’s correct. So for the from address I used an info alias that I have set up. For the login however, I used the primary email address on the account along with an app password rather than my email account password.
So to recap:
Admin email = info alias
SMTP from email = info alias
STMP login = email account login with app password for additional security

Hope this helps!

Thanks!

However, this does not work for me.

Thank you! Worked!