748 0 0 0
Last Updated : 2025-04-28 18:14:28
Here is a sample simple code to send email message in laravel
$data = array('name'=>'Roger Jackson', "date" => "01/01/2020", "myName"=>"Jack Hamelton"); //These array keys can be accessed directly in the blade template as variables/
Mail::send('emails.testEmail', $data, function($message) {
$message->to(config('app.NotificationEmailAddress'), config('app.NotificationEmailName'))
->subject('Test Email #'. rand(1, 1000));
});
Now create a blade template in resources/views/mail folder
Hello,
This is a test message
<p>
{{ $myName }}
If you haven't asked for this request, please ignore this message completely.
Thank you