I tried to configure email sending with smtp driver and using port 587 with tls encryption, on the mail server everything seems to be configured correctly (because it can send and receive emails).
The problem is when I try it on Flarum, the email is sent and can be received but there is an error notification Oops! Something went wrong. Please reload the page and try again.
and there is no error log in /storage/logs
.
In debug there is an error like this:
POST https://my.domain/api/mail/test
<br />
<b>Deprecated</b>: Callables of the form ["Swift_SmtpTransport", "Swift_Transport_EsmtpTransport::__construct"] are deprecated in <b>/www/my.domain/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php</b> on line <b>36</b><br />
<br />
<b>Deprecated</b>: Callables of the form ["Swift_Message", "Swift_Mime_SimpleMessage::__construct"] are deprecated in <b>/www/my.domain/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php</b> on line <b>46</b><br />
<br />
<b>Fatal error</b>: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in /www/my.domain/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:20
Stack trace:
#0 /www/my.domain/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(42): Laminas\HttpHandlerRunner\Exception\EmitterException::forOutputSent()
#1 /www/my.domain/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(21): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput()
#2 /www/my.domain/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(75): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit()
#3 /www/my.domain/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#4 /www/my.domain/public/index.php(26): Flarum\Http\Server->listen()
#5 {main}
thrown in <b>/www/my.domain/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php</b> on line <b>20</b><br />
Flarum information
Flarum core: 1.8.9
PHP version: 8.3.12
MySQL version: 8.0.35
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, ctype, curl, dom, filter, ftp, gd, gettext, hash, iconv, intl, json, SPL, session, pcntl, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, random, Reflection, mysqli, shmop, SimpleXML, soap, sockets, sodium, sysvsem, tokenizer, xml, xmlreader, xmlwriter, zip, mbstring, fileinfo, exif
+--------------------------+---------+--------+
| Flarum Extensions | | |
+--------------------------+---------+--------+
| ID | Version | Commit |
+--------------------------+---------+--------+
| flarum-flags | v1.8.2 | |
| flarum-approval | v1.8.2 | |
| flarum-tags | v1.8.3 | |
| flarum-suspend | v1.8.4 | |
| flarum-subscriptions | v1.8.1 | |
| flarum-sticky | v1.8.2 | |
| flarum-statistics | v1.8.1 | |
| flarum-mentions | v1.8.5 | |
| flarum-markdown | v1.8.1 | |
| flarum-lock | v1.8.2 | |
| flarum-likes | v1.8.1 | |
| flarum-lang-english | v1.8.0 | |
| flarum-extension-manager | v1.0.5 | |
| flarum-emoji | v1.8.1 | |
| flarum-bbcode | v1.8.0 | |
+--------------------------+---------+--------+
Base URL: https://my.domain
Installation path: /www/my.domain
Queue driver: sync
Session driver: file
Mail driver: smtp
Debug mode: ON