• Edited

Installation Process

Yesterday/today, I installed Flarum. Everything is working fine except for emails—I am not receiving confirmation emails or test emails from the admin settings.

Initially, I tried using SMTP (Gmail) and spent five hours troubleshooting, but I couldn’t get it to work. I also attempted Mailgun, but it’s not a viable option for me since it has limitations on the number of emails I can send.

Today, I attempted to configure SMTP using my web hosting provider’s mail server (Hetzner). I contacted Hetzner support, and they told me my SMTP host is www629.your-server.de. I entered all the required details, but it’s still not working.

SMTP Configurations

Gmail SMTP Configuration (Didn't Work)

`Addresses (Default): noreply@forum.yivani.de
Outgoing Email Format: Default (Multipart)
Choose a Driver: SMTP

Host: smtp.gmail.com
Port: 587
Encryption: TLS (or tsl)
Username: forum.yivani@gmail.com
Password: App Password (I tried this method; my forum account had stricter security than my main account)
`
✅ IMAP was enabled in Gmail.
However, emails still did not send.

Hetzner SMTP Configuration (Also Didn't Work)

`Addresses (Default): noreply@forum.yivani.de
Outgoing Email Format: Default (Multipart)
Choose a Driver: SMTP

Host: www629.your-server.de (also tried mail.your-server.de)
Port: 587
Encryption: TLS (or tsl)
Username: info@yivani.de
Password: Mail account password (set when creating the email)
`
Again, emails did not send

Flarum Installation Steps

I installed Flarum by first installing Composer and verifying its version:
composer --version
Then, I installed Flarum using:
composer create-project flarum/flarum . --stability=beta
It installed various dependencies, and I then installed the Extension Manager:
composer require flarum/extension-manager:"*"

Configuration File (config.php)

Here is my config.php file:
<?php return array (
'debug' => false,
'database' =>
array (
'driver' => 'mysql',
'database' => 'forum_db',
'prefix' => '',
'prefix_indexes' => true,
'host' => 'sql573.your-server.de',
'port' => 3306,
'username' => 'USERNAME',
'password' => 'PASSWORD',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'engine' => 'InnoDB',
'strict' => false,
),
'url' => 'https://forum.yivani.de',
'paths' =>
array (
'api' => 'api',
'admin' => 'admin',
),
'headers' =>
array (
'poweredByHeader' => true,
'referrerPolicy' => 'same-origin',
),
'mail' =>
array (
'driver' => 'smtp',
'host' => 'www629.your-server.de',
'port' => 587,
'encryption' => 'tls',
'username' => 'info@yivani.de',
'password' => 'PASSWORD',
'from' =>
array (
'address' => 'info@yivani.de',
'name' => 'Yivani Forum',
),
),
);

Troubleshooting Steps Tried (Still Not Working)

✅ Enabled IMAP for Gmail.
✅ Tried Mailgun (not an option due to email limitations).
✅ Contacted Hetzner support and verified SMTP host settings.
✅ Attempted different configurations for TLS and SMTP hosts.

Any Suggestions on What Might Be Wrong?
If anyone has experience with Flarum SMTP configurations, I’d appreciate your help!

  • luceos and SychO replied to this.
  • I fixed it

    So the fix is: I deleted everything and reinstalled it again for the 20th time.

    And I installed it with composer create-project flarum/flarum,
    then I cleared my server cache and reset my DNS settings. Idk why, but it helped. Now I have to configure the DNS again, but it was worth it. Now the mail function is working fine with the rest of it.

    i also didn't need to add stuff to the config.php

    Thx for the helps in this post i hope someone will not have the same problem as me

    • Edited

    Yivani if this is a new server/vps, the ports for sending are likely blocked. Hosting provider do that to prevent spam runs. Usually you can ask them to deblock it, or you can try alternate ports.

      Yivani but it’s still not working

      Ok, what error do you see while testing it? Eg from the storage/logs?

        luceos

        My log folder is empty idk why

          • Edited

          luceos

          here is my flarum info
          Flarum Info Image

          Debug i tried also
          i enable it again

          when i pressed send test mail there is no error

          but when i try resend the confirmation mail this comes up

          `POST https://forum.yivani.de/api/users/2/send-confirmation

          Flarum\Post\Exception\FloodingException in /usr/www/users/yivanib/forum/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php:28
          Stack trace:
          #0 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Api\Middleware\ThrottleApi->process()
          #1 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(40): Laminas\Stratigility\Next->handle()
          #2 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\CheckCsrfToken->process()
          #3 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/CheckForMaintenanceMode.php(37): Laminas\Stratigility\Next->handle()
          #4 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\CheckForMaintenanceMode->process()
          #5 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(54): Laminas\Stratigility\Next->handle()
          #6 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\ResolveRoute->process()
          #7 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/SetLocale.php(43): Laminas\Stratigility\Next->handle()
          #8 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\SetLocale->process()
          #9 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle()
          #10 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\AuthenticateWithHeader->process()
          #11 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Laminas\Stratigility\Next->handle()
          #12 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\AuthenticateWithSession->process()
          #13 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(44): Laminas\Stratigility\Next->handle()
          #14 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\RememberFromCookie->process()
          #15 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/StartSession.php(44): Laminas\Stratigility\Next->handle()
          #16 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\StartSession->process()
          #17 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
          #18 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Api\Middleware\FakeHttpMethods->process()
          #19 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
          #20 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\ParseJsonBody->process()
          #21 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(43): Laminas\Stratigility\Next->handle()
          #22 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\HandleErrors->process()
          #23 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
          #24 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\InjectActorReference->process()
          #25 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(77): Laminas\Stratigility\Next->handle()
          #26 /usr/www/users/yivanib/forum/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
          #27 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Middlewares\RequestHandler->process()
          #28 /usr/www/users/yivanib/forum/vendor/middlewares/base-path-router/src/BasePathRouter.php(99): Laminas\Stratigility\Next->handle()
          #29 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Middlewares\BasePathRouter->process()
          #30 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
          #31 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Laminas\Stratigility\Middleware\OriginalMessages->process()
          #32 /usr/www/users/yivanib/forum/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
          #33 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Middlewares\BasePath->process()
          #34 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
          #35 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\ProcessIp->process()
          #36 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(77): Laminas\Stratigility\Next->handle()
          #37 /usr/www/users/yivanib/forum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(66): Laminas\Stratigility\MiddlewarePipe->process()
          #38 /usr/www/users/yivanib/forum/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(73): Laminas\Stratigility\MiddlewarePipe->handle()
          #39 /usr/www/users/yivanib/forum/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
          #40 /usr/www/users/yivanib/forum/public/index.php(26): Flarum\Http\Server->listen()
          #41 {main}`

            Yivani seems you're hitting the throttling of the confirmation sending endpoint from testing too much. I just signed up with a dummy account and it seems to work just fine?

              luceos

              But you can't resive the confirmation mail right? and the test mail should also work but its not its saying that it send but i don't resive anything

              First and foremost Flarum 2.0 beta is not meant for production sites.

              Secondly I tried signing up with a working email address and the mail didn't arrive. Contact hetzner support to see if they block email ports, go from there. Also it's weird that you have no errors in your logs, did you check the right folder?

                Yivani composer create-project flarum/flarum . --stability=beta

                Why stability beta? You should reinstall but without that flag so that it installs the stable 1.8 version

                  SychO Stable is also not working with the mails

                  luceos yea i did check it right i did that 20 times in the last 2 days

                  • Edited
                  • Best Answerset by Yivani

                  I fixed it

                  So the fix is: I deleted everything and reinstalled it again for the 20th time.

                  And I installed it with composer create-project flarum/flarum,
                  then I cleared my server cache and reset my DNS settings. Idk why, but it helped. Now I have to configure the DNS again, but it was worth it. Now the mail function is working fine with the rest of it.

                  i also didn't need to add stuff to the config.php

                  Thx for the helps in this post i hope someone will not have the same problem as me