[GH-ISSUE #1761] Email Invite not working #969

Closed
opened 2026-02-26 02:34:47 +03:00 by kerem · 2 comments
Owner

Originally created by @gader-abdollah on GitHub (Apr 17, 2024).
Original GitHub issue: https://github.com/koel/koel/issues/1761

Screenshot from 2024-04-17 13-06-13

The player fails to send email invites to users

To reproduce

  1. Go to Users > Invite
  2. Enter a single email such as abc@example.com
  3. Leave admin role unchecked
  4. See Unknown error

Environment

  • Koel version v6.12.1
  • Server OS: Ubuntu via Portainer
  • Laptop OS: Fedora 39
  • Browser: Firefox 124.0.1 (64-bit)
  • PHP version 8.1.8

Additional context
I did not test with multiple emails as I only need to send an invite to a single person.
Here is the stack I used:

version: '3'

services:
  koel:
    image: phanan/koel
    restart: always
    depends_on:
      - database
    ports:
      - some_port:80
    environment:
      - FORCE_HTTPS=true
      - SPOTIFY_CLIENT_ID=ehem
      - SPOTIFY_CLIENT_SECRET=ehem
      - YOUTUBE_API_KEY=ehem
      - LASTFM_API_KEY=scusi
      - LASTFM_API_SECRET=eeeeeeeeeh_nope
      - DB_CONNECTION=*****
      - DB_HOST=******
      - DB_USERNAME=*****
      - DB_PASSWORD=*******
      - DB_DATABASE=******
    volumes:
      - music:/music
      - covers:/var/www/html/public/img/covers
      - search_index:/var/www/html/storage/search-indexes


  database:
    image: mariadb:10.11
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=*****
      - MYSQL_DATABASE=*****
      - MYSQL_USER=*****
      - MYSQL_PASSWORD=******

volumes:
  db:
    driver: local
  music:
    driver: local
  covers:
    driver: local
  search_index:
    driver: local

Once it was up, I ran these commands:

php artisan koel:init --no-assets && apt update && apt dist-upgrade -y && apt install inotify-tools -y
echo '#!/bin/bash

MEDIA_PATH=/music

inotifywait -rme move,close_write,delete --format "%e %w%f" $MEDIA_PATH | while read file; do
  php artisan koel:sync "${file}"
done' > watch
chmod +x watch && ./watch & disown -h

This is the initial setup with watch setup.

I have no idea why it is not working. Maybe it cannot send emails in general ?
Anyway, it is also running behind Nginx Proxy Manager but the connection is coming through no problem...
Is there a need to open more ports for email sending maybe ??

Originally created by @gader-abdollah on GitHub (Apr 17, 2024). Original GitHub issue: https://github.com/koel/koel/issues/1761 ![Screenshot from 2024-04-17 13-06-13](https://github.com/koel/koel/assets/91209082/96bd7665-0382-4ee9-9d9c-332958d8a5a4) The player fails to send email invites to users **To reproduce** 1. Go to Users > Invite 2. Enter a single email such as abc@example.com 3. Leave admin role unchecked 4. See Unknown error **Environment** - Koel version v6.12.1 - Server OS: Ubuntu via Portainer - Laptop OS: Fedora 39 - Browser: Firefox 124.0.1 (64-bit) - PHP version 8.1.8 **Additional context** I did not test with multiple emails as I only need to send an invite to a single person. Here is the stack I used: ```yaml version: '3' services: koel: image: phanan/koel restart: always depends_on: - database ports: - some_port:80 environment: - FORCE_HTTPS=true - SPOTIFY_CLIENT_ID=ehem - SPOTIFY_CLIENT_SECRET=ehem - YOUTUBE_API_KEY=ehem - LASTFM_API_KEY=scusi - LASTFM_API_SECRET=eeeeeeeeeh_nope - DB_CONNECTION=***** - DB_HOST=****** - DB_USERNAME=***** - DB_PASSWORD=******* - DB_DATABASE=****** volumes: - music:/music - covers:/var/www/html/public/img/covers - search_index:/var/www/html/storage/search-indexes database: image: mariadb:10.11 restart: always volumes: - db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=***** - MYSQL_DATABASE=***** - MYSQL_USER=***** - MYSQL_PASSWORD=****** volumes: db: driver: local music: driver: local covers: driver: local search_index: driver: local ``` Once it was up, I ran these commands: ```bash php artisan koel:init --no-assets && apt update && apt dist-upgrade -y && apt install inotify-tools -y echo '#!/bin/bash MEDIA_PATH=/music inotifywait -rme move,close_write,delete --format "%e %w%f" $MEDIA_PATH | while read file; do php artisan koel:sync "${file}" done' > watch chmod +x watch && ./watch & disown -h ``` This is the initial setup with watch setup. I have no idea why it is not working. Maybe it cannot send emails in general ? Anyway, it is also running behind Nginx Proxy Manager but the connection is coming through no problem... Is there a need to open more ports for email sending maybe ??
kerem closed this issue 2026-02-26 02:34:47 +03:00
Author
Owner

@roccolate commented on GitHub (Apr 30, 2024):

Hi, i was having the same issue, let me share what i did to fix it:

in the .env file take a look at this lines:

# The following settings are for Koel to send emails, for example to send user invitations and reset passwords. MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}" MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null

make sure you complete that part, i used my websites email, created music@mywebsite.com, added a password and used SMTP . i added those details to the file and that fixed my error

<!-- gh-comment-id:2087683618 --> @roccolate commented on GitHub (Apr 30, 2024): Hi, i was having the same issue, let me share what i did to fix it: in the .env file take a look at this lines: `# The following settings are for Koel to send emails, for example to send user invitations and reset passwords. MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}" MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null ` make sure you complete that part, i used my websites email, created music@mywebsite.com, added a password and used SMTP . i added those details to the file and that fixed my error
Author
Owner

@gader-abdollah commented on GitHub (Jun 1, 2024):

Hi, i was having the same issue, let me share what i did to fix it:

in the .env file take a look at this lines:

# The following settings are for Koel to send emails, for example to send user invitations and reset passwords. MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}" MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null

make sure you complete that part, i used my websites email, created music@mywebsite.com, added a password and used SMTP . i added those details to the file and that fixed my error

Thanks, this works for me 👍
Maybe, this should be added to the documentation 🤔

<!-- gh-comment-id:2143412566 --> @gader-abdollah commented on GitHub (Jun 1, 2024): > Hi, i was having the same issue, let me share what i did to fix it: > > in the .env file take a look at this lines: > > `# The following settings are for Koel to send emails, for example to send user invitations and reset passwords. MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}" MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null ` > > make sure you complete that part, i used my websites email, created [music@mywebsite.com](mailto:music@mywebsite.com), added a password and used SMTP . i added those details to the file and that fixed my error Thanks, this works for me :+1: Maybe, this should be added to the documentation :thinking:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#969
No description provided.