Laravel on Localhost - Connection could not be established with host smtp.gmail.com [Connection timed out #110]
It's look like your .ENV
still have cache.
Please try this way
php artisan config:cache
php artisan cache:clear
And try to debug at your Controller
dd(env('MAIL_HOST'));
If it's still get smtp.gmail.com
. Please try this way.
Edit your config/app.php
. And add below 'env' => env('APP_ENV', 'production'),
'mail_host' => env('MAIL_HOST', 'smtp.mailgun.org'),
And try to debug at your Controller
dd(config('app.mail_host'));
I'm sure it's will show smtp.mailgun.org
After that you can delete the line you has just added to config/app.php
Connection could not be established with host smtp.gmail.com Network is unreachable #101 error in Laravel email
I solved my problem in cpanel using the code:
change MAIL_DRIVER=smtp to MAIL_DRIVER=sendmail in ".env" file
Connection could not be established with host smtp.gmail.com [Connection refused #111] in laravel 5.6 email send
Problem Solved.
I made the change two things here MAIL_DRIVER and MAIL_PORT.
MAIL_DRIVER=sendmail
MAIL_PORT=587
So, my full code is:
MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail@gmail.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=ssl
It works fine
Related Topics
Arabic Characters in JSON Decoding
How to Store Birthdate and Age So That Age Can Be Updated Daily in PHP/Mysql
Basic Simplexml Working Example
Get "Content-Type" Header of Request in PHP
Make Text Wrap in a Cell with Fpdf
In PHP, How to Get the First and Last Date of a Month
Forcing Access to _Php_Incomplete_Class Object Properties
Codeigniter: 404 Page Not Found on Live Server
Select Last 20 Order by Ascending - PHP/Mysql
How to Set Session Timeout in Laravel
PHP Pdo Insert Batch Multiple Rows with Placeholders
Running Imagemagick on Xampp 1.8.3 with Windows 7
Designing a Secure Auto Login Cookie System in PHP
MySQL PHP - Select Where Id = Array()
Woocommerce - Send Custom Email on Custom Order Status Change