Problem sending emails with Laravel 5.4

0

I'm trying to send email with the Laravel Mail class as follows.

Code:

Mail::send('companies.emails.register', ['company' => $company], function ($m) use ($company) {
   $m->to($company->email, $company->name)->subject('Cadastro de Construtora!');
});

Configuration:

MAIL_ADMIN=email@admin
MAIL_ADMIN_NAME=Contato
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=email@email
MAIL_PASSWORD=****
MAIL_ENCRYPTION=tls

Error:

Connection could not be established with host smtp.gmail.com [Connection timed out #110]

I think the problem is not in the code, but in some config of the server but I have no idea.

    
asked by anonymous 09.06.2017 / 20:28

1 answer

1

I found the problem, it was a block of my hosting, digital ocean by default blocks the sending of emails.

    
12.06.2017 / 14:50