Sending plaintext emails in Laravel without a Mailable
Sometimes you just want to send a simple email from within a Laravel controller or somewhere else, without having to create a whole āmailableā class.
In these cases, you can use the Mail::raw
method:
use Illuminate\Support\Facades\Mail;
Mail::raw('Hello there!', function ($message) {
$message->from('mail@example.com', 'From Name');
$message->to('recipient@gmail.com');
$message->subject('Youāve got mail');
});