I have a hello world template and I'm trying to send emails with this template in a for loop, I receipt the three mails but only the first mail shows the "hello world" and the other are empty. HELP!!!
function testMail(Request $request) {
for ($i = 0; $i < 3; $i++) {
$data = array();
Mail::send('preview', $data, function($message) {
$message->from('test@gmail.com');
$message->to('test@gmail.com')->subject('Bla test: ');
});
}
}
Note: I will send different content to different emails. That's why I'm not making an array.