I need to send some test emails from Laravel and want to do it, without Mail classes, etc. I usually use the Mail::send()
function for this and it works fine. However, I’ve just realized that cc/bcc recipients don’t seem to work when using this form.
In case useful to know, I’m using sendmail.
$result=Mail::send('site.emails.empty-template', ['msg'=>"Hi this is a test msg"], function ($message) {
$message->from('[email protected]');
$message->subject("A test email");
$message->to("[email protected]");
$message->cc("[email protected]");
$message->bcc(["[email protected]","[email protected]]);
});
3
Answers
Did you try like this:
You can use
Mail::send
method, and by using this, you can customize yoursubject
andbody
.OR
you may use this one
Create a new mailable class
Use class to send the email
In bcc there’s an " closing issue:
You can visit these links as a reference:
Send e-mail without implementing a Mailable class #41632
Laravel send email without Mailable
You can also try like this: