How does @component come into it?
Just send as before?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, Whats different for 5.4 mails now? Mailables.. but thats lots of work to change for all in all projects. This really simple example doesnt work anymore since upgraded..
The docs are not clear anymore about email.. just refering to mailables and markdown.. I have my emails all in html..
This Function:
public function contact(Request $request)
{
$this->validate($request, [
'name' => 'required',
'email' => 'required|email|max:255',
'content' => 'required',
]);
$data = $request->all();
Mail::send(['html' => 'emails.contact'], $data, function ($m) use ($data) {
$m->from($data['email'], $data['name']);
$m->cc($data['email'], $data['name']);
$m->to(config('mail.from.address'), config('mail.from.name'));
});
return redirect()->back()->with('success', 'Done');
}
With this view:
@component('mail::message')
<p>{{ $name }} ({{ $email }} {{ $phone }})</p>
<p><i>
{!! nl2br($content) !!}
</i></p>
@endcomponent
Please or to participate in this conversation.