dev-master
9999999-devUse Illuminate Mail outside Laravel.
MIT
The Requires
2.0.1
2.0.1.0Use Illuminate Mail outside Laravel.
MIT
The Requires
2.0.0
2.0.0.0Use Illuminate Mail outside Laravel.
MIT
The Requires
Wallogit.com
2017 © Pedro Peláez
Use Illuminate Mail outside Laravel.
composer require illuminate/config, (*1)
composer require illuminate/mail, (*2)
composer require hazzard/mail, (*3)
composer require guzzlehttp/guzzle (required for Mailgun and Mandrill), (*4)
use Hazzard\Mail\Mail; use Illuminate\Container\Container; use Illuminate\Config\Repository as Config; // Create a container and config repository. $app = new Container; $app['config'] = new Config; // Set the mail & services configuration. $app['config']['mail'] = require 'config/mail.php'; $app['config']['services'] = require 'config/services.php'; $mail = new Mail($container); // Set the storage path used by the views. $mail->setViewStoragePath(_DIR__.'/path/to/views'); // Make the instance available globally via static methods (optional). $mail->setAsGlobal(); // Create a class alias (optional). $mail->classAlias();
Mail::send('emails.welcome', ['key' => 'value'], function ($message) {
$message->to('foo@example.com', 'John Smith')->subject('Welcome!');
});
The rest is the same as Laravel., (*5)
To provide a custom view factory register a view binding to the container., (*6)
The view factory must implement Illuminate\Contracts\View\Factory and the view Illuminate\Contracts\View\View (or at least to have a render method)., (*7)
$container['view'] = new CustomViewFactory();
Use Illuminate Mail outside Laravel.
MIT
Use Illuminate Mail outside Laravel.
MIT
Use Illuminate Mail outside Laravel.
MIT