// $data => array of information passed to view
Mail::send('email_view', $data, function ($m) use ($user) {
$m->from("example@gmail.com", config('app.name', 'APP Name'));
$m->to($user->email, $user->name)->subject('Email Subject!');
});
$arrayEmails = ['someone@mail.com','stranger@mail.com'];
$emailSubject = 'My Subject';
$emailBody = 'Hello, this is my message content.';
Mail::send('emails.normal',
['msg' => $emailBody],
function($message) use ($arrayEmails, $emailSubject) {
$message->to($arrayEmails)
->subject($emailSubject);
}
);
Mail::send(['html' => 'admin.email-template.lowstock'], array('totalUsers' => $totalUsers, 'item' => $item,'data' =>$data), function ($message) use ($user_to_mail, $item) {
$message->from('POS@gmail.com', 'POS');
$message->subject('Notification Mail');
foreach ($user_to_mail as $mail) {
$message->to($mail->email);
}
});
}
Mail::raw('Text to e-mail', function ($message) {
//
});