Cannot send email via SMTP

I am trying to use the SMTP functionality without success and I cannot understand what is going wrong.

The credentials work with other systems (from Python to other services that use SMTP).

I tried multiple authentications (Login, Plain, None) and different encyptions, but the error returned is always the same.

I tried to enable the debug but I did not received additional information at all.

Is anyone able to help me?

Thanks

Steps to reproduce

  1. Open Settings/General

  2. Insert SMTP data

  3. Try to send email

Expected behaviour

I expect the email to be sent.

Actual behaviour

An error is returned:

Server configuration

Operating system:

Web server:

Database:

PHP version:

ownCloud version: 10.15.3.0 Community

Updated from an older ownCloud or fresh install: fresh install

Where did you install ownCloud from: Docker

The content of config/config.php:

  'mail_smtphost' => 'mail.smtp2go.com',
  'mail_smtpport' => '2525',
  'mail_smtpdebug' => true,
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'My email user',
  'mail_smtppassword' => 'My password',
  'mail_smtpauthtype' => 'LOGIN',

Client configuration

Browser: Brave

Operating system: Win 11

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

[24/Aug/2025:12:12:42 +0200] "POST /settings/admin/mailtest HTTP/1.1" 200 1003 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"

Browser log

no log

I probably found what caused the issue.

When the SMTP settings exist also in the environment variables, the config.php settings are ignored. Both if you change them from the wizard and directly from the file.

You have to act on the variables before hitting the Send Mail button.

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