Connection could not be established with host smtp.gmail.com

Posted 1 year ago by omarsow94

Every informations about my gmail account are OK, but the error still

config/mail.php

<?php

return [



    'driver' => env('MAIL_DRIVER', 'smtp'),

 

    'host' => env('MAIL_HOST', 'smtp.gmail.com'),

  

    'port' => env('MAIL_PORT', 587),


    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', '[email protected]'),
    ],

   

    'encryption' => env('MAIL_ENCRYPTION', 'tls'),

    

    'username' => env('MAIL_USERNAME'),

    'password' => env('MAIL_PASSWORD'),

   
    'sendmail' => '/usr/sbin/sendmail -bs',

    

    'markdown' => [
        'theme' => 'default',

        'paths' => [
            resource_path('views/vendor/mail'),
        ],
    ],

];

AND my .env file

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=tls

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.