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

situ314's avatar

Laravel Mail failover not working in laravel forge

Good afternoon, I was working with a simple app that sends emails. I am using the failovr, since I am using 2 mailers, one is Mailgun, and the other is sendgrid.

In local everything works correctly, when the mail from Mailgun fails, it goes to sendgrid and tries to send it. But when I uploaded it to Laravel forge, apparently this functionality doesn't work anymore. If Mailgun's corrode fails, it's like it keeps trying, and never progresses. Does anyone know what it could be?

This is my config

'default' => 'failover',

        'mailgun' => [
            'transport' => 'mailgun',
            'url' => env('MAIL_URL'),
            'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
            'port' => env('MAIL_PORT', 587),
            'encryption' => env('MAIL_ENCRYPTION', 'tls'),
            'username' => env('MAIL_USERNAME'),
            'password' => env('MAIL_PASSWORD'),
            'timeout' => 50,
            'local_domain' => env('MAIL_EHLO_DOMAIN'),
        ],

        'sendgrid' => [
            'transport' => 'smtp',
            'url' => env('MAIL_URL'),
            'host' => env('MAIL_HOST_BACKUP', 'smtp.mailgun.org'),
            'port' => env('MAIL_PORT', 587),
            'encryption' => env('MAIL_ENCRYPTION', 'tls'),
            'username' => env('MAIL_USERNAME_BACKUP'),
            'password' => env('MAIL_PASSWORD_BACKUP'),
            'timeout' => null,
            'local_domain' => env('MAIL_EHLO_DOMAIN'),
        ],
0 likes
0 replies

Please or to participate in this conversation.