I was building a website which can send mail to my account on the page view.
I have edited my .env
file like this :
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=example@example.com
MAIL_PASSWORD=example
MAIL_ENCRYPTION=null
username and password is set as example for this question only, on original file I have given my original name and email.
And my mail.php
file looks like this:
'from' => [
'address' => 'hello@example.com',
'name' => 'Example',
],
With other function ^^
MyRoute file looks like this:
Route::get('/send', function() {
Mail::send('email.send', ['name' => 'Its me'], function($message) {
$message->to('example@example.com', 'Someone')->from('someone@somewhere.com')->subject('Worked');
});
});
Here also username and name is set as example || Its me on here only, on original file I have given my original name and email.
And my email/send.blade.php
file is having only {{$name}}
I used the tutorial from youtube inorder to study this.
Still I get an error like this
How can I fix this error? Please help me.