المشاركات

عرض المشاركات من يوليو, ٢٠١٨

How to Send Email in Laravel 5.6 using Gmail SMTP

صورة
Hi! Today let's see how to send email in laravel 5.6 using gmail smtp server . Since Laravel 5.3, the framework comes with the clean, simple API to send mails quickly via localhost or cloud based service. You can simply use the 'Mailable' class to build your emails. These classes collect the data and pass it to the view. Any property set as public will be available in the view file. So all you have to do is to set the class property as public and access it via the blade template. You can also send customized data explicitly using the with() method. Please refer the laravel documentation for more details. Laravel - Sending Email via Gmail SMTP: Laravel utilizes the 'config\mail.php' file to store all the mail settings. Here is where you have to configure MAIL_DRIVER, MAIL_HOST, MAIL_PORT, etc. But you don't have to directly make changes to this file. You can simply provide those details on the '.env' file found in the app root and laravel will a