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.