mfcRogue
1 year ago

Sending Multiple Emails to contacts from database with CC?

Posted 1 year ago by mfcRogue

Hi, I'm still getting used to all the ins and outs of both OOP and Laravel.

So I have a database with two email address, one is personal one is work, some people only have a work and some people only have personal, others have both (or not at all). The data also comes from 3 different queries.

I've managed to get this information into array $email[] and $email2[]

But When I test it shows

Address in mailbox given [] does not comply with RFC 2822, 3.6.2.

The current send code is

Mail::send('mail',  $email, function($message) use($email,$surname,$email2)  {
$message->to($email, $surname)
->subject('Vehicle Reminder');
 $message->from('[email protected]','Company Name');
})
->cc($email2)
;

Can anyone point me in the right direction - the from email is place holder.

Please sign in or create an account to participate in this conversation.