0
I am trying to email 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!');
});
Setup:
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 server config but I have no idea.
You seem to be right. Have you authorized your gmail account to allow "less secure" apps? The link is: https://myaccount.google.com/lesssecureapps, just check the box.
– Diego Schmidt
I’d already done it and still the mistake continues.
– Kayo Bruno
Your application is in what environment?
– Diego Schmidt
https://stackoverflow.com/questions/28433816/how-to-fix-could-not-open-socket-in-zend-mail-zend-framework-2/28436702#28436702
– felipsmartins