E-mail a PDF file
This example shows how to create a PDF file and e-mail it:
E-mailing with attachments by yourself is full of unexpected obstacles. Instead of building the message by hand, we will
use a 3rd party library.
E-mailing with Swift mailer
First, require Swift mailer with command
$ composer require swiftmailer/swiftmailer
Then, create a Swift Message and send it with a Transport wrapping PHP mail() function.
For more information about Swift Mailer, see its documentation.