0
I need my system to simultaneously send emails to all the emails in the comic book. Following the code below it only sends the first email from the list and still sends wrong. Sends to spam. And the code msm I use in the contact form d that sends to inbox perfectly. Ms without the foreach.
public function sendEmail()
{
$emails = $this->emailRepository->EmailByStatus();
$description = 'teste';
$subject = 'teste';
$data = array('description'=>$description, 'subject'=>$subject);
foreach ($emails as $email)
{
$send = Mail::send('email.email-multiple', $data, function($message) use($emails, $description, $subject)
{
$message->to($email)->subject($subject);
$message->from('email@fantasia');
});
}
if(!$send)
{
return 0;
}
return 1;
}
Tbm tried it like this:
foreach($emails as $email)
{
$message->to($email);
}
Tbm only sends the 1st and wrong tbm. And qnd sends.
What’s wrong with the code above?
How do I delete the question? kkkk Mr Admins, can close. I switched to from.
– hisoka