This package provides a flexible way to assist you in extending the Laravel mail service, it is the missing multi-mail implementation for Laravel 5.3.
The Laravel mail service provides a number of elegant ways to send e-mails, such as Mailer (the Mail facade), Mailable, MailableMailer, and the new Mail Notification. Before getting started using this package, make sure you have read the official mail documentation. This package will not change the way you are already familiar with sending e-mails, but help you customize the Laravel mail service, such as managing multi mail drivers at runtime, handling messages that are ultimately sent.
The Mailer class is the facade and the maincenter of the Laravel mail system, all sending tasks will be handled by this class. You may access it using the Mail facade or app('mailer') helper function, as well as the Mailer type-hint or dependency injection.
The SwiftMailerManager singleton manages all Swift Mailer instances and their corresponding Swift Transport instances for the Mailer, it creates, caches, resets or destroys them. Each Swift Mailer instance is identified by the driver name of its transporter, such as smtp, mailgun, etc. You may access the manager via Mail::getSwiftMailerManager(), app('swift.manager'), SwiftMailerManager type-hint or dependency injection.
It provides several helper methods for operating the mail messages, such as getting domain names of the email addresses for the mail recipients.
Below are several examples of usage. Remember, you can do any customization as you want.
Custom Mail Drivers
Laravel ships with a handful of mail drivers, but you may want to write your own drivers to send emails via other mail services. Laravel makes it simple. By using the extend method of the TransportManager singleton, you can register a custom driver creator.