Sending mail fails with a valid address

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x): AIO v12.5.0
  • Operating system and version (e.g., Ubuntu 24.04): Debian 12
  • Web server and version (e.g, Apache 2.4.25): nginx 10
  • Reverse proxy and version _(e.g. nginx 1.27.2)
  • PHP version (e.g, 8.3): from Docker
  • Is this the first time you’ve seen this error? (Yes / No): Yes
  • When did this problem seem to first start? Installation
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.) : Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No) : No

Summary of the issue you are facing:

I’m trying to configure a fresh AIO instance to send notification mails. The mail address I use has been verified (login / password / authentication) with a desktop mail client.

Therefore I fill all configuration fields using the same values:

but always get an error:

`TransportException
Failed to authenticate on SMTP server with username "ncnotif@mydomain.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 5.7.1 Authentication failed".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 5.7.1 Authentication failed".".

Quite surprising to see that the expected authentication is “PLAIN”, and trying Ciphering = SSL doesn’t change anything…

I’ve abundantly browsed through the forum and found several posts dealing with the same issue, but they’re clearly obsolete (see [solved] Problem sending test E-Mail - #3 by Chrizneko93 ), all modifications made in the UI are properly written in the config.php file, so I dont know if this smtp.config.php is still used by the application.

Found nothing in the configuration documentation either (yes, RTFM :wink:)…

Thanks in advance for any help!

A mail server usually expects SSL/TLS on port 465. SARTTLS is typically offered via port 587. So, I would either try changing the port to 587 or the encryption to SSL/TLS.

EDIT: Based on the log message you posted, it looks like it could establish a connection, but then the server reports 535 5.7.1 Authentication failed.

Is the username/password correct? Or does the account perhaps have 2FA or OAuth or some other authentication method enforced, so that password login no longer works? In this case, you may need to set an app password on the mail server/mail provider’s administration interface.

Still, port 465 should usually be SSL/TLS, so the configuration you posted will most likely not work, even if the login credentials are correct.

Hi @bb77 ,

I’ve tried SSL/465 and STRTTLS/587 but to no avail. Username and password have been checked with Outlook, no 2FA nor OAuth… This is why I’m wondering about the role of smtp.config.php.

Thanks for your help!