Laravel 5 mail format html with css

1

I'm sending an email through Mail of laravel 5

$data = Input::all();
        Mail::send('mails.sendteste', $data, function ($message) {
            $message->from('[email protected]', 'Sistema');
            $message->subject('Teste');
            $message->to('[email protected]');

        });

I'm using the code above that loads a view that contains CSS scripts but when the email arrives for me, it does not read the css and the email gets all unformatted ..

Is there any way to set up Headers as done in pure php?

Note: I tried using the Laravel Mail Css Inline but it had no effect whatsoever.

    
asked by anonymous 30.03.2016 / 15:44

1 answer

2

Take a look at the lavender documentation link

It says the following:

Mailing Plain Text By default, the view given to the send method is assumed to contain HTML. However, by passing an array as the first argument to the send method, you may specify a plain text view to send in addition to the HTML view: Mail :: send (['html.view', 'text.view'], $ data, $ callback); Or, if you just need to send a plain text email, you may specify this using the text key in the array: Mail :: send (['text' => 'view'], $ data, $ callback);

That is, if you want to send the email in text format use:

Mail::send(['text' => 'view'], $data, $callback);

In HTML format use

Mail::send(['html' => 'view'], $data, $callback);

Or use the automatic format

Mail::send(['html.view', 'text.view'], $data, $callback);
    
30.03.2016 / 23:19