Home > Net >  Laravel 9 Unsupported mail transport []
Laravel 9 Unsupported mail transport []

Time:10-05

I have Unsupported mail transport" error when send an email in laravel 9 project.

Here is my .env

MAIL_DRIVER = smtp
MAIL_HOST = smtp.gmail.com
MAIL_PORT = 587
MAIL_USERNAME = *****@gmail.com
MAIL_PASSWORD = *******
MAIL_ENCRYPTION = tls
MAIL_FROM_ADDRESS=*****@gmail.com

Here is my config/mail.php

    'mailers' => [
        'smtp' => [
            'driver' => env('MAIL_DRIVER', 'smtp'),
            'host' => env('MAIL_HOST', 'smtp.gmail.com'),
            'port' => env('MAIL_PORT', 587),
            'from' => ['address' => '*****', 'name' => '*****'],
            'encryption' => env('MAIL_ENCRYPTION', 'tls'),
            'username' => env('MAIL_USERNAME'),
            'password' => env('MAIL_PASSWORD'),
            'sendmail' => '/usr/sbin/sendmail -bs',
            'pretend' => false,
        ],

Please help me. Thanks!

CodePudding user response:

i fixed my config/mail.php like this.

'smtp' => [
            'transport' => 'smtp',
            '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' => null,
            'auth_mode' => null,
        ],

CodePudding user response:

Welcome to stack overflow!

I have experienced issues in the past when there has been spaces besides the = try removing these.

Can you provide some logs or errors for further debugging

  • Related