open config/mail.php, .env files and set your email driver as mail as bellow,
'driver' => env('MAIL_DRIVER', 'mail'), //you must set it in env file too
then you can send emails like bellow, note that emails.admin.member, is the path to your email template, in the example code, laravel will look for a blade template in the path, resources\views\emails\admin\member.blade.php
Mail::queue('emails.admin.member', $data, function($message) {
$message->subject("A new Member has been Registered" );
$message->from('[email protected]', 'Your application title');
$message->to('[email protected]');
});
or use send function
Mail::send('emails.admin.member', $data, function($message) {
$message->subject("A new Member has been Registered" );
$message->from('[email protected]', 'Your application title');
$message->to('[email protected]');
});
the difference between them is, if you have a performance concern, go for queue method and it will send the emails in the background process without waiting to process the script, send function will wait until the emails be sent to continue the script..