Looking to hire Laravel developers? Try LaraJobs

laravel-phpmailer maintained by madeinua

Description
PHPMailer transport for Laravel
Last update
2022/09/27 16:44 (dev-master)
License
Links
Downloads
12

Comments
comments powered by Disqus

PHPMailer transport for Laravel

About

This package provides a simple way to use PHPMailer with Laravel to handle sending emails.

Installation

You can install the package via composer:

composer require "madeinua/laravel-phpmailer"

or manually add the following to your composer.json file:

"madeinua/browser-console": "^1.0"

You also need to publish the service provider:

php artisan vendor:publish --provider="LaravelPHPMailer\PHPMailerServiceProvider" --tag="transporter-config"

or by adding the provider to the config/app.php file:

'providers' => [
    ...
    // Illuminate\Mail\MailServiceProvider::class,
    LaravelPHPMailer\PHPMailerServiceProvider::class,
],

Then in the config/mail.php, under mailers, you need to add a new entry:

'mailers' => [
    ...
    'phpmailer' => [
        'transport' => 'phpmailer'
    ]
],

Usage

When the package is installed and configured, all emails will be sent using PHPMailer:

Mail::to($request->user())
    ->cc($moreUsers)
    ->bcc($evenMoreUsers)
    ->send(new OrderShipped($order));