I am using the Mail function in laravel in the SwiftMailer library.
Mail::send('mail', array('key' => $todos1), function($message) { $message->to(array(' TEST@example.com ',' TESsdT@example.com ',' TESjxfjT@example.com ',' TESfssdT@example.com '))->subject('Welcome!'); });
The above function sends mail to several users, but users know who all mail is sent to, because its address consists of
To: TEST@example.com , TESsdT@example.com , TESjxfjT@example.com , TESfssdT@example.com
So, to fix this, I used the foreach , which sends the email messages separately
foreach($to as $receipt){ //Mail::queue('mail', array('key' => $todos1), function($message) use ($receipt) Mail::send('mail', array('key' => $todos1), function($message) use ($receipt) { $message->to($receipt)->subject('Welcome!'); }); }
The above code is working fine ...
My question is whether there is any function in this advanced infrastructure that could send letters to users with a unique address to (i.e.), without one user knowing how many others use the same mail sent without using foreach ...
source share