Hi,
I migrated from 4.5 to v5 yesterday and since then I am trying to get email sending to work. But I can’t get IN to send emails neither through SMTP nor the “standard” way which I suppose is sendmail. Both are available on my server.
Note that I can successfully send a test email from the email smtp settings in IN. But no matter what settings I choose, the .env file never changes.
I can also successfully run this:
php artisan tinker
\Mail::mailer('smtp')->raw('hello world', function($message) {
$message->subject('Testing email')->to('[email protected]');
});
I thought maybe the cron job is not running buit even when starting it manually there are no emails being send. I switched to supervisor whose logs look great:
2024-04-22 14:55:57 App\Services\Email\Email ....................... RUNNING
2024-04-22 14:56:01 App\Services\Email\Email ................... 3 Sek. DONE
2024-04-22 14:56:01 App\Listeners\Quote\QuoteEmailActivity ......... RUNNING
2024-04-22 14:56:01 App\Listeners\Quote\QuoteEmailActivity .... 50.43ms DONE
2024-04-22 14:56:01 App\Listeners\Quote\QuoteEmailedNotification ... RUNNING
2024-04-22 14:56:01 App\Listeners\Quote\QuoteEmailedNotification 32.66ms DONE
2024-04-22 14:57:20 App\Services\Email\Email ....................... RUNNING
2024-04-22 14:57:23 App\Services\Email\Email ................... 3 Sek. DONE
2024-04-22 14:57:25 App\Listeners\Quote\QuoteEmailActivity ......... RUNNING
2024-04-22 14:57:25 App\Listeners\Quote\QuoteEmailedNotification ... RUNNING
2024-04-22 14:57:25 App\Listeners\Quote\QuoteEmailActivity .... 58.39ms DONE
2024-04-22 14:57:25 App\Listeners\Quote\QuoteEmailedNotification 63.81ms DONE
Obviously, it’s trying to do some email magic for around 3 seconds - but still there are no mails actually being send.
I am on a fresh selh-hosted IN which shows me my system info as:
PHP:
web: 8.2.18
cli: PHP 8.2.18 (cli) (built: Apr 11 2024 20:37:35) (NTS)
Memory: 128M
API: 5.8.50
here is the relevant part of my .env file:
DB_CONNECTION="mysql"
MULTI_DB_ENABLED=false
DB_HOST="localhost"
DB_DATABASE="ninja"
DB_USERNAME="XXX"
DB_PASSWORD="XXX"
DB_PORT="3306"
DEMO_MODE=false
BROADCAST_DRIVER=log
LOG_CHANNEL=stack
CACHE_DRIVER=file
QUEUE_CONNECTION=database #also didn't work with the original "sync"
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER="smtp" #also tried sendmail here
MAIL_HOST="XXX"
MAIL_PORT="587"
MAIL_USERNAME="XXX"
MAIL_PASSWORD="XXX"
MAIL_ENCRYPTION="tls"
MAIL_FROM_ADDRESS="XXX@XXX"
MAIL_FROM_NAME="XXX"
MAIL_VERIFY_PEER=false
Enabling debug mode didn’t yield any additional output, also storage/logs/laravel.log is empty.
After every change I called /update?secret=secret but I can’t say if this has any effect, I simply get redirected to the dashboard without any success message or error.
I also run php artisan optimize
.
What else could I try to make email work?
thanks!