Personal I created a command to send emails of invoices generated, in the controller it works normally and email is sent, but when I execute the command laravel does not send email.
follow the code below:
public function handle()
{
$dataAtual = date('Y-m-d');
$primeiroAvisoVencimento = date("Y-m-d", strtotime("+ 10 days", strtotime($dataAtual)));
$fatura = Fatura::where('data_vencimento', $primeiroAvisoVencimento)->first();
Mail::to('[email protected]')->send(new PrimeiroAvisoFatura($fatura));
$this->info('E-mail enviado com sucesso ...');
}
MAIL_DRIVER = log , and in the log file the email sent when I execute the command appears, and when I put MAIL_DRIVER = smtp does not send. p>