Skip to content
Advertisement

Laravel 5 and PHPMailer

Does anybody have a working example how I can work with PHPMailer in Laravel 5? In Laravel 4 it was quiet simple to use but the same method doesn’t work in L5. Here it is what I did in L4:

Added in composer.json:

JavaScript

And in the controller I’ve used it like this:

JavaScript

But it doesn’t work in L5. Any idea? Thanks!

Advertisement

Answer

Well there are multiple mistakes i think… This is a working example of sending mail with PhpMailer in Laravel 5. Just tested it.

JavaScript

And of course, you need to do a composer update after adding the depency to composer.json

However, i would prefer the laravel built in SwiftMailer. http://laravel.com/docs/5.0/mail

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement