Sending a mail without creating a Mailable in Laravel 5.5
Asked Answered
S

1

13

I don't see anything about sending Mail without creating a Mailable class in Laravel 5.5 documentation. I know it was possible before (5.2) but I don't remember how.

Is it still possible? Is it deprecated? Is there something I missed in the documentation? How can I send a mail without creating a Mailable in Laravel 5.5?

I would like something like:

Mail::fromText('hello world')->to('[email protected]')->send();
Selfannihilation answered 20/11, 2017 at 14:22 Comment(0)
F
29

I think it's not deprecated but it's assumed now that you will send more complex mails via Mailables. But it should be still possible to send mail like this:

\Mail::raw('hello world', function($message) {
   $message->subject('message subject')->to('[email protected]');
});
Fauve answered 20/11, 2017 at 14:33 Comment(1)
Will it be deprecated? I think it has to be a simple way to send emails too. Not only the complex waySistrunk

© 2022 - 2024 — McMap. All rights reserved.