Hi,
i got error AxiosError: Request failed with status code 400 when try to Test and verify email settings Send Email
i fill corecectly for smtp but always get same error
Using Nextcloud Hub 9 (30.0.6) on Ubuntu server 24.04.1
Hi,
i got error AxiosError: Request failed with status code 400 when try to Test and verify email settings Send Email
i fill corecectly for smtp but always get same error
Using Nextcloud Hub 9 (30.0.6) on Ubuntu server 24.04.1
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.
'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.
'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 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
Hello, I encountered the same issue as you when using the same deployment version and environment, but even editing the configuration file cannot solve the problem. Can you give me some advice?
My conf configuration is as follows:
{
"system": {
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"10.1.1.2:11224"
],
"dbtype": "mysql",
"version": "30.0.6.2",
"overwrite.cli.url": "https:\/\/10.1.1.2:11224",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"password": "***REMOVED SENSITIVE VALUE***"
},
"theme": "",
"loglevel": 2,
"maintenance": false,
"appstoreenabled": true,
"default_phone_region": "CN",
"default_language": "zh_CN",
"default_locale": "zh",
"enable_previews": true,
"enabledPreviewProviders": {
"0": "OC\\Preview\\Imaginary",
"19": "OC\\Preview\\TXT",
"1": "OC\\Preview\\MarkDown",
"2": "OC\\Preview\\OpenDocument",
"3": "OC\\Preview\\PDF",
"4": "OC\\Preview\\MSOffice2003",
"5": "OC\\Preview\\MSOfficeDoc",
"6": "OC\\Preview\\PDF",
"7": "OC\\Preview\\Image",
"8": "OC\\Preview\\Photoshop",
"9": "OC\\Preview\\TIFF",
"10": "OC\\Preview\\SVG",
"11": "OC\\Preview\\Font",
"12": "OC\\Preview\\MP3",
"13": "OC\\Preview\\Movie",
"14": "OC\\Preview\\MKV",
"15": "OC\\Preview\\MP4",
"16": "OC\\Preview\\AVI",
"17": "OC\\Preview\\EMF",
"18": "OC\\Preview\\Krita",
"20": "OC\\Preview\\WEBP"
},
"preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
"preview_format": "webp",
"app_install_overwrite": [
"files_markdown"
],
"maintenance_window_start": 1,
"twofactor_enforced": "true",
"twofactor_enforced_groups": [],
"twofactor_enforced_excluded_groups": [],
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "25",
"mail_smtpauth": 1,
"mail_smtptimeout": 30,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
}
}
It should be noted that my Mariadb version is not recommended for V30.0.6. Is this related to it?
Thank you, now its work now. change manualy on config
‘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
’,
‘mail_smtptimeout’ => 30,
‘mail_smtpname’ => ‘user@smtphost.com’,
‘mail_smtppassword’ => ‘supersecretpassword’,
also i think because time out on default config is not set.
Well, used all those tricks from above , but none of them does the trick.
i am not able to send any mail via nextcloud.
very annoying.
I ran into the same error…
I was confused
After some experiments I found it. The error was probably caused by a wrong email address (mail recipient) in my nextcloud admin account. The provider rejected the email immediately because he could verify it didn’t exist.
Glad that it worked out for you.
Thanks a lot! It’s working now…
I tried all the suggested fixes aswell, but I still get this error.
Hi everybody,
I have the same problem. Ubuntu 24 and Nextcloud 30.0.6.
I cinfigured authentication, timeout and another email provider, but same result.
Is there any other idea?Thanks.
Hi All,
I ran into the same error message. When I debug the request, it showed me that I haven’t set the email address for admin user that I’m trying test i.e. adding email to Personal Settings → email , fixed my issue. Hope this helps.
It’s a fresh installation of Nextcloud Hub 9 (30.0.6)
Cheers,
Janaka
I have solved my question. If the problem occurs, you can try the following methods to solve it:
'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',
'mail_smtptimeout' => 30,
'mail_smtpname' => ' user@smtphost.com ',
'mail_smtppassword' => 'supersecretpassword',
Note that it is necessary to add the configuration of ‘mail_stmtptimeout’=>30.
delete line first and save, open and edit. dont forget restart service
it’s works for me use solution from nano11bravo
This worked, thanks!
I have the same issue - I configured the email server as mention here - but still the same
Not working for me aswell, it was all ok until I updated to Nextcloud Hub9. Manual changes to configuration files don’t solve the problem. All email notifications stopped working.
Same problem for me, I have tried all of the above and its still not working, also i have tried with a fresh install of nextcloud and its the same, even after manually editing the config.php file.
Underlying system is Truenas Scale ElectricEel-24.10.2
Freshly registered to write my solution:
I have searched half the internet and changed the configuration files several times. Even on my parallel installed cloud I have not noticed any difference… with one tiny little difference: I had not yet entered an email address in the admin account. So Nextcloud couldn’t send an email (to where?) and spit out this cryptic error. I hope I could help some of you with this and maybe in the next versions the error message will be more precise or you will be forced to enter an email address directly during the installation.
same here…
That solution worked for me. Just adding an email address to the admin account did the trick.