Sending email in Laravel with Gmail account

Today we will go to discuss about  how to sending an emails to the users in Laravel 4 with gmail account. By default Laravel 4 has swiftmailer package to send the emails by using the proper SMTP configuration. If you want to send emails with gmail SMTP server then you must give proper configuration to mail.php file.

Here i have given my mail configuration file.

My app/config/mail.php configurations for sending email through Gmail SMTP server

Sample code to send email:

first argument “emails.test-email” is my email template. (info: You must keep your email templates at your app in this path “appviewsemails”) .  Second argument is dynamic data that we like to pass to that view file and third argument is cosure of the message object.

Sending email in Laravel 4 with Gmail Account

Sending email in Laravel 4 with Gmail Account

Thanks…..

Note:

Please don’t forget to share and subscribe to latest updates of the blog .