Failed to connect to smtp.gmail.com [Operation timed out # 60]

I cannot send an email in my local environment.

I keep getting:

enter image description here _

.env.

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME=my-email@gmail.com MAIL_PASSWORD=***** 

Note Amazing I have the same setup on my production server and it works great.

Any hints / suggestions?

+9
source share
5 answers

Update my driver string to

MAIL_DRIVER=sendmail

It works on the first try.

The final .env should look like this:

 MAIL_DRIVER=sendmail MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME=my-email@gmail.com MAIL_PASSWORD=***** 
+24
source

For me, the following worked with GMAIL:

 'encryption' => 'ssl', 

.env

 MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME=xxx@gmail.com MAIL_PASSWORD=xxx 
+2
source

1: either you must allow less secure applications, or use the application password by enabling 2-step verification in your gmail acc. 2: Disable any antivirus on your computer.

0
source

Change the setting in the .env file and save the credentials of the mail server after configuring smtp

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME=xxx MAIL_PASSWORD=xxx

0
source

Laravel also includes drivers for the Mailgun and Mandrill HTTP interfaces. These APIs are often simpler and faster than SMTP servers. Both of these drivers require the Guzzle 5 HTTP library to be installed in your application. You can add Guzzle 5 to your project by adding the following line to your composer.json file:

 "guzzlehttp/guzzle": "~5.0" composer update 

Mailgun driver

To use the Mailgun driver, set the driver option for mail in the config / mail.php configuration file. Then create the config / services.php configuration file if it does not already exist for your project. Make sure it contains the following options:

 'mailgun' => [ 'domain' => 'your-mailgun-domain', 'secret' => 'your-mailgun-key', ], 

Mandrill Driver

To use the Mandrill driver, set the mandrill driver parameter in the config / mail.php configuration file. Then create the config / services.php configuration file if it does not already exist for your project. Make sure it contains the following options:

 'mandrill' => [ 'secret' => 'your-mandrill-key', ], 

Main use

 The Mail::send method may be used to send an e-mail message: Mail::send('emails.welcome', ['key' => 'value'], function($message) { $message->to(' foo@example.com ', 'John Smith')->subject('Welcome!'); }); 

http://laravel.com/docs/5.0/mail

-1
source

Source: https://habr.com/ru/post/988461/


All Articles