How to send email without a view

1

All the tutorials I think, including the official documentation show how to send emails using views.

How to send emails without any view? How does the system routine automatically?

    
asked by anonymous 31.07.2016 / 05:35

2 answers

0
public function email()
{
    Mail::send([], [], function ($message)
    {
        $message->to('[email protected]')
            ->subject('EMAIL TESTE AUTOMÁTICO')
            ->setBody('CORPO DA MENSAGEM DE EMAIL TESTE!!!');
    });
    return "email enviado";
}
    
31.07.2016 / 16:11
0

The correct one would be to use the method raw and not send

Mail::raw('CORPO DA MENSAGEM DE EMAIL TESTE!!!', function ($message) {
    $message->to('[email protected]')
        ->subject('EMAIL TESTE AUTOMÁTICO')        
});

See the documentation .

    
31.07.2016 / 17:24