Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

helpme's avatar

Laravel 5.7 mail notification able to send email on local but not on production

As above title said, I was able to send email on local via notification with onqueue using same the email configuration with production but was not able to send email on production via notification with onqueue. Please help! :(

My production server is shared hosting Hostgator

the .env file MAIL_DRIVER=smtp MAIL_PORT=465 MAIL_ENCRYPTION=ssl and was cache cleared. If local works then why not on production as in server?

            $when = Carbon::now()->addSeconds(10);
            $user->notify((new NewStuff(auth()->user()->name, $stuff, $repo))->delay($when));

NewStuff: namespace App\Notifications;

use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage;

class NewStuff extends Notification implements ShouldQueue { use Queueable;

0 likes
3 replies
ahmeddabak's avatar

First thing, since your notification implements ShouldQueue, what is your queue driver?

it can be that you are using sync on local but database on production, in this case you need to run php artisan queue:work --tries=3 in the terminal on your production server.

also many hosting companies block outgoing mail ports to prevent websites with malware from sending spam emails, call your host 's support and check if they block outgoing mail ports.

helpme's avatar

@AHMEDDABAK - hi i managed to solve this problem already. Thanks for your assistance! :)

Please or to participate in this conversation.