You can follow this video.
And that tutorial is for Laravel 4, I hope that you use newer version of Laravel, at least 5.8.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
after researching Laravel mailables, I have become more confused.
I have a 'complete' button that when clicked, I would like an email to be sent to the logged in user. So far I have: Ensured that the following in Mail.php 'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 587,
'from' => array('address' => 'mywebappemail.com', 'name' => 'mywebapp Name'),
'encryption' => 'tls',
'username' => 'mywebappemail.com',
'password' => 'mywebappemail.compassword',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
my env file: MAIL_DRIVER=smtp MAIL_HOST=smtp.googlemail.com MAIL_PORT=465 [email protected] MAIL_PASSWORD=mywebappemailpassword MAIL_ENCRYPTION=ssl
I understand that I need a method, however, unsure as to where to put it because I am wanting to send an email when a button is clicked and not when the user has created or stored something.
I've been following a website (https://code.tutsplus.com/tutorials/sending-emails-with-laravel-4-gmail--net-36105) and found the following method however not sure where to put it and how to adapt it for my web app.
Mail::send('folder.view', $data, function($message) { $message->to('registered-user@gmail. com', 'Jon Doe')->subject('Welcome to the Laravel 4 Auth App!'); });
I am really new to Laravel, please be kind.
Thanks in advance.
Please or to participate in this conversation.